Quellcode durchsuchen

fix/mobile notification android 13 (#1175)

* fix(mobile) runtime notification permission rule Android 13

* Format
Alex vor 2 Jahren
Ursprung
Commit
ab0a3690f3
1 geänderte Dateien mit 24 neuen und 11 gelöschten Zeilen
  1. 24 11
      mobile/android/app/src/main/AndroidManifest.xml

+ 24 - 11
mobile/android/app/src/main/AndroidManifest.xml

@@ -1,11 +1,20 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.alextran.immich" xmlns:tools="http://schemas.android.com/tools">
-  <application android:label="Immich" android:name=".ImmichApp" android:usesCleartextTraffic="true" android:icon="@mipmap/ic_launcher" android:requestLegacyExternalStorage="true">
-    <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.alextran.immich"
+  xmlns:tools="http://schemas.android.com/tools">
+  <application android:label="Immich" android:name=".ImmichApp" android:usesCleartextTraffic="true"
+    android:icon="@mipmap/ic_launcher" android:requestLegacyExternalStorage="true">
+    <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop"
+      android:theme="@style/LaunchTheme"
+      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
+      android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
       <!-- Specifies an Android theme to apply to this Activity as soon as
       <!-- Specifies an Android theme to apply to this Activity as soon as
-                 the Android process has started. This theme is visible to the user
-                 while the Flutter UI initializes. After that, this theme continues
-                 to determine the Window background behind the Flutter UI. -->
-      <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
+                 the
+      Android process has started. This theme is visible to the user
+                 while the
+      Flutter UI initializes. After that, this theme continues
+                 to determine the
+      Window background behind the Flutter UI. -->
+      <meta-data android:name="io.flutter.embedding.android.NormalTheme"
+        android:resource="@style/NormalTheme" />
       <intent-filter>
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
         <category android:name="android.intent.category.LAUNCHER" />
@@ -25,7 +34,8 @@
       </intent-filter>
       </intent-filter>
     </activity>
     </activity>
     <!-- Don't delete the meta-data below.
     <!-- Don't delete the meta-data below.
-             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
+             This is used by the Flutter tool to
+    generate GeneratedPluginRegistrant.java -->
     <meta-data android:name="flutterEmbedding" android:value="2" />
     <meta-data android:name="flutterEmbedding" android:value="2" />
     <!-- Disables default WorkManager initialization to use our custom initialization -->
     <!-- Disables default WorkManager initialization to use our custom initialization -->
     <provider
     <provider
@@ -33,14 +43,17 @@
       android:authorities="${applicationId}.androidx-startup"
       android:authorities="${applicationId}.androidx-startup"
       tools:node="remove"></provider>
       tools:node="remove"></provider>
   </application>
   </application>
+
+
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
   <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
-  <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <!-- If you want to read images-->
-  <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <!-- If you want to read videos-->
-  <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" /> <!-- If you want to read audio-->
+  <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
+  <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
+  <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
+  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
 
 
   <queries>
   <queries>
     <intent>
     <intent>