[android] add required permission annotations

This commit is contained in:
Salakar 2017-09-29 11:33:44 +01:00
parent a9d8cc6c69
commit d3ea57f76d
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package io.invertase.firebase.analytics; package io.invertase.firebase.analytics;
import android.support.annotation.RequiresPermission;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.NativeModule;
@ -13,6 +15,9 @@ import java.util.List;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class RNFirebaseAnalyticsPackage implements ReactPackage { public class RNFirebaseAnalyticsPackage implements ReactPackage {
@RequiresPermission(
allOf = {"android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE", "android.permission.WAKE_LOCK"}
)
public RNFirebaseAnalyticsPackage() { public RNFirebaseAnalyticsPackage() {
} }

View File

@ -1,5 +1,7 @@
package io.invertase.firebase.storage; package io.invertase.firebase.storage;
import android.support.annotation.RequiresPermission;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.NativeModule;
@ -13,6 +15,9 @@ import java.util.List;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class RNFirebaseStoragePackage implements ReactPackage { 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() { 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 * 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. * 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<Class<? extends JavaScriptModule>> createJSModules() { public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList(); return Collections.emptyList();
} }