We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2d07082 + 58e4661 commit 7d0b84dCopy full SHA for 7d0b84d
android/src/main/java/com/onesignal/flutter/OneSignalNotifications.java
@@ -78,6 +78,12 @@ else if (call.method.contentEquals("OneSignal#addNativeClickListener"))
78
79
private void requestPermission(MethodCall call, Result result) {
80
boolean fallback = (boolean) call.argument("fallbackToSettings");
81
+ // if permission already exists, return early as the method call will not resolve
82
+ if (OneSignal.getNotifications().getPermission()) {
83
+ replySuccess(result, true);
84
+ return;
85
+ }
86
+
87
OneSignal.getNotifications().requestPermission(fallback, Continue.with(permissionResult -> {
88
replySuccess(result, permissionResult.getData());
89
}));
0 commit comments