瀏覽代碼

Stop asking for Overlay permission on RN >= 52

Guy Carmeli 6 年之前
父節點
當前提交
b52ac6d057

+ 5
- 0
lib/android/app/build.gradle 查看文件

@@ -50,18 +50,23 @@ android {
50 50
     productFlavors {
51 51
         reactNative51 {
52 52
             dimension "RNN.reactNativeVersion"
53
+            buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "51")
53 54
         }
54 55
         reactNative55 {
55 56
             dimension "RNN.reactNativeVersion"
57
+            buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "55")
56 58
         }
57 59
         reactNative56 {
58 60
             dimension "RNN.reactNativeVersion"
61
+            buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "56")
59 62
         }
60 63
         reactNative57 {
61 64
             dimension "RNN.reactNativeVersion"
65
+            buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
62 66
         }
63 67
         reactNative57WixFork {
64 68
             dimension "RNN.reactNativeVersion"
69
+            buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
65 70
         }
66 71
     }
67 72
 }

+ 4
- 2
lib/android/app/src/main/java/com/reactnativenavigation/react/DevPermissionRequest.java 查看文件

@@ -9,6 +9,7 @@ import android.util.Log;
9 9
 import android.widget.Toast;
10 10
 
11 11
 import com.facebook.react.common.ReactConstants;
12
+import com.reactnativenavigation.BuildConfig;
12 13
 
13 14
 public class DevPermissionRequest {
14 15
 
@@ -20,8 +21,9 @@ public class DevPermissionRequest {
20 21
 
21 22
 	public boolean shouldAskPermission(Activity activity) {
22 23
 		return isDebug &&
23
-				Build.VERSION.SDK_INT >= 23 &&
24
-				!Settings.canDrawOverlays(activity);
24
+               Build.VERSION.SDK_INT >= 23 &&
25
+               BuildConfig.REACT_NATVE_VERSION_MINOR <= 51 &&
26
+               !Settings.canDrawOverlays(activity);
25 27
 	}
26 28
 
27 29
 	@TargetApi(23)