Merge pull request #1164 from geriux/master

[Android] Support for areNotificationsEnabled
This commit is contained in:
Chris Bianca 2018-06-17 16:27:03 +01:00 committed by GitHub
commit 69b2921ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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