Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 59191d9

Browse files
Crash after push notification confirmation #205
Error: "null is not an object (evaluating 'app.registerForRemoteNotifications')" #218
1 parent 5535950 commit 59191d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

firebase.ios.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ firebase._registerForRemoteNotifications = function (app) {
216216
if (!error) {
217217
console.log("User granted push notifications? " + granted);
218218
// applicationSettings.setBoolean("registered", true);
219-
app.registerForRemoteNotifications();
219+
if (app === null) {
220+
app = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
221+
}
222+
if (app !== null) {
223+
app.registerForRemoteNotifications();
224+
}
220225
} else {
221226
console.log("Error requesting push notification auth: " + error);
222227
}

0 commit comments

Comments
 (0)