Skip to content

Commit

Permalink
Resolve correct boolean when permission denied
Browse files Browse the repository at this point in the history
* result.isSuccess() always returns true because this is Whether the coroutine call was successful
* result.getData() holds the value
  • Loading branch information
nan-li committed Oct 23, 2023
1 parent 868e5a7 commit 6b9ac44
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,11 @@ public void onNotificationPermissionChange(boolean permission) {
@ReactMethod
public void requestNotificationPermission(final boolean fallbackToSettings, Promise promise) {
OneSignal.getNotifications().requestPermission(fallbackToSettings, Continue.with(result -> {
promise.resolve(result.isSuccess());
if (result.isSuccess()) {
promise.resolve(result.getData());
} else {
promise.reject(result.getThrowable().getMessage());
}
}));
}

Expand Down

0 comments on commit 6b9ac44

Please sign in to comment.