Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit a529d01

Browse files
committed
Fix requestPermission crash
1 parent ccd9edc commit a529d01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ public void requestPermissions(String senderID) {
130130

131131
Intent GCMService = new Intent(reactContext, RNPushNotificationRegistrationService.class);
132132

133-
GCMService.putExtra("senderID", senderID);
134-
reactContext.startService(GCMService);
133+
try {
134+
GCMService.putExtra("senderID", senderID);
135+
reactContext.startService(GCMService);
136+
} catch (Exception e) {
137+
Log.d("EXCEPTION SERVICE::::::", "requestPermissions: " + e);
138+
}
135139
}
136140

137141
@ReactMethod

0 commit comments

Comments
 (0)