Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/android/com/gae/scaffolder/plugin/FCMPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ public void run() {
try {
if (Build.VERSION.SDK_INT >= 33) { // Android 13+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if SKD is lower than 33? There should be else block with callbackContext.success(1);.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right it seems ok to me, would you like to apply the fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is applied in this PR

boolean hasRuntimePermission = hasRuntimePermission(POST_NOTIFICATIONS);
if (!hasRuntimePermission) {
if (hasRuntimePermission) {
callbackContext.success(1);
}
else {
String[] permissions = new String[]{qualifyPermission(POST_NOTIFICATIONS)};
postNotificationPermissionRequestCallbackContext = callbackContext;
requestPermissions(plugin, POST_NOTIFICATIONS_PERMISSION_REQUEST_ID, permissions);
Expand Down