diff --git a/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java b/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java index 530b5375..3bc702bb 100644 --- a/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java +++ b/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.support.annotation.NonNull; import android.support.v4.content.LocalBroadcastManager; +import android.support.v4.app.NotificationManagerCompat; import android.util.Log; import com.facebook.react.bridge.Promise; @@ -59,7 +60,8 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule { // Non Web SDK methods @ReactMethod public void hasPermission(Promise promise) { - promise.resolve(true); + Boolean enabled = NotificationManagerCompat.from(getReactApplicationContext()).areNotificationsEnabled(); + promise.resolve(enabled); } @ReactMethod