You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
When the application has been killed completely, and a notification is tapped in the action center, the application launches but does not process the notification correctly. This is the flow of actions that occurred during my investigation:
didReceiveRemoteNotification is fired; stores the notification as launchNotification.
applicationDidBecomeActive is fired; uses launchNotification to invoke notificationReceived.
notificationReceived is fired; processes and fires it into JavaScript world.
Cordova becomes ready, init is fired, and JavaScript event handlers are attached.
At (4), the notification from (3) is lost. Some observations to handle the situation gracefully:
notificationReceived does not check if the callbackId is registered yet (L244).
init recognizes a pending notificationMessage and invokes notificationReceived (L111).
So, notificationReceived merely needs to check if callbackId is available. Replace:
When the application has been killed completely, and a notification is tapped in the action center, the application launches but does not process the notification correctly. This is the flow of actions that occurred during my investigation:
didReceiveRemoteNotification
is fired; stores the notification aslaunchNotification
.applicationDidBecomeActive
is fired; useslaunchNotification
to invokenotificationReceived
.notificationReceived
is fired; processes and fires it into JavaScript world.init
is fired, and JavaScript event handlers are attached.At (4), the notification from (3) is lost. Some observations to handle the situation gracefully:
notificationReceived
does not check if thecallbackId
is registered yet (L244).init
recognizes a pendingnotificationMessage
and invokesnotificationReceived
(L111).So,
notificationReceived
merely needs to check ifcallbackId
is available. Replace:On https://github.com/phonegap/phonegap-plugin-push/blob/master/src/ios/PushPlugin.m#L244 with:
A pull request seemed like overkill for a one-line change. I'd appreciate it if this was merged 👍
The text was updated successfully, but these errors were encountered: