Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): allow declaring features/permissions in app manifest #2071

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

tido64
Copy link
Member

@tido64 tido64 commented Jun 7, 2024

Description

Allow declaring features/permissions in app manifest

Resolves #2069

Platforms affected

  • Android
  • iOS
  • macOS
  • visionOS
  • Windows

Test plan

cd example/android
./gradlew assembleDebug

# Verify generated manifest is same as `android/app/src/main/AndroidManifest.xml` content-wise
cat app/build/generated/rnta/src/main/AndroidManifest.xml

Declare features/permissions e.g.:

diff --git a/example/app.json b/example/app.json
index 3b8992ea..ecd6d313 100644
--- a/example/app.json
+++ b/example/app.json
@@ -13,6 +13,23 @@
       "presentationStyle": "modal"
     }
   ],
+  "android": {
+    "features": [
+      {
+        "android:name": "android.hardware.bluetooth"
+      },
+      {
+        "android:glEsVersion": "0x00030002",
+        "android:required": "true"
+      }
+    ],
+    "permissions": [
+      {
+        "android:name": "android.permission.WRITE_EXTERNAL_STORAGE",
+        "android:maxSdkVersion": "18"
+      }
+    ]
+  },
   "resources": {
     "android": [
       "dist/res",

Re-run ./gradlew assembleDebug and verify AndroidManifest.xml has been updated.

@github-actions github-actions bot added platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS platform: Windows This affects Windows platform: visionOS labels Jun 7, 2024
@tido64 tido64 force-pushed the tido/android-manifest branch 3 times, most recently from 023f26c to 29bf52b Compare June 8, 2024 07:13
@tido64 tido64 force-pushed the tido/android-manifest branch 2 times, most recently from fb0694d to a941a4d Compare June 8, 2024 07:28
@tido64 tido64 marked this pull request as ready for review June 11, 2024 13:11
@tido64 tido64 requested a review from acoates-ms as a code owner June 11, 2024 13:11
@tido64 tido64 enabled auto-merge (squash) June 11, 2024 17:16
@tido64 tido64 merged commit cfd02ee into trunk Jun 11, 2024
30 checks passed
@tido64 tido64 deleted the tido/android-manifest branch June 11, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS platform: visionOS platform: Windows This affects Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: declare permissions and device compatibility in app manifest
2 participants