From d3ea57f76d8a233ca4199f1f264893375c70b164 Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 29 Sep 2017 11:33:44 +0100 Subject: [PATCH] [android] add required permission annotations --- .../firebase/analytics/RNFirebaseAnalyticsPackage.java | 5 +++++ .../firebase/storage/RNFirebaseStoragePackage.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java b/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java index c1526610..15fe7c9e 100644 --- a/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java +++ b/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java @@ -1,5 +1,7 @@ package io.invertase.firebase.analytics; +import android.support.annotation.RequiresPermission; + import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; @@ -13,6 +15,9 @@ import java.util.List; @SuppressWarnings("unused") public class RNFirebaseAnalyticsPackage implements ReactPackage { + @RequiresPermission( + allOf = {"android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE", "android.permission.WAKE_LOCK"} + ) public RNFirebaseAnalyticsPackage() { } diff --git a/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java index b2668c6f..114a1218 100644 --- a/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java +++ b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java @@ -1,5 +1,7 @@ package io.invertase.firebase.storage; +import android.support.annotation.RequiresPermission; + import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; @@ -13,6 +15,9 @@ import java.util.List; @SuppressWarnings("unused") public class RNFirebaseStoragePackage implements ReactPackage { + @RequiresPermission( + allOf = {"android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"} + ) public RNFirebaseStoragePackage() { } @@ -35,7 +40,7 @@ public class RNFirebaseStoragePackage implements ReactPackage { * listed here. Also listing a native module here doesn't imply that the JS implementation of it * will be automatically included in the JS bundle. */ - // TODO: Removed in 0.47.0. Here for backwards compatability + // TODO: Removed in 0.47.0. Here for backwards compatibility public List> createJSModules() { return Collections.emptyList(); }