Merge pull request #1164 from geriux/master
[Android] Support for areNotificationsEnabled
This commit is contained in:
commit
69b2921ec2
|
@ -6,6 +6,7 @@ import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
|
import android.support.v4.app.NotificationManagerCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.facebook.react.bridge.Promise;
|
import com.facebook.react.bridge.Promise;
|
||||||
|
@ -59,7 +60,8 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule {
|
||||||
// Non Web SDK methods
|
// Non Web SDK methods
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void hasPermission(Promise promise) {
|
public void hasPermission(Promise promise) {
|
||||||
promise.resolve(true);
|
Boolean enabled = NotificationManagerCompat.from(getReactApplicationContext()).areNotificationsEnabled();
|
||||||
|
promise.resolve(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
|
Loading…
Reference in New Issue