-
Notifications
You must be signed in to change notification settings - Fork 1.9k
PushPlugin.m init() should send pending notification when js side is ready #658
Comments
I'm also experiencing this problem on android (version 5.0.2). Rolling back to |
@jimmy-tfp can you show the native code for your temporary fix? Also where you added it (line number) ? This may help the non native folks out there |
my hack is near line 245 of PushPlugin.m Here is a larger cut of that file showing the lines above and below the hack:
}
|
Thanks, just curious, if there is more than 1 unread notification in the tray, does it still pick just the one that was tapped on and alert/log it? Right now when I use alert. It seems like it is picking all of them and the latest one get alerted twice. |
This thread has been automatically locked. |
On iOS:
Expected Behaviour
When your app is "not running" and you click a notification for that app, in PushPlugin.init() it finds "notificationMessage" and sends that to the app when the app is ready
Actual Behaviour
When your app is "not running" and you click a notification for that app, in PushPlugin.init() it finds "notificationMessage" and sends that to the app right away and the app has not had a chance to setup the rest of the calls needed to catch the notification.
Reproduce Scenario (including but not limited to)
Steps to Reproduce
see above
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS 9.2.1, 6 and 6p
Sample Push Data Payload
payload = json.dumps({
'aps': {
'alert': 'Push Test %d: %s' % (ident, str(uuid.uuid4())[:8]),
'badge': 4
}
})
Sample Code that illustrates the problem
here is my service initialize:
function initialize () {
Logs taken while reproducing problem
not sure how to get them...
The "Fix"
to "fix" this I put a delay before sending out the initial notification.
// if there is a pending startup notification, go ahead and process it after a delay to let the js warmup
if (notificationMessage) {
dispatch_async(dispatch_get_main_queue(), ^{
// it works everytime with 0.3 so 1.2 is just majik
[self performSelector:@selector(notificationReceived) withObject:nil afterDelay: 1.2];
});
}
However it seems like the real fix should be to have a new method in the plugin called "IamFinallyReadyToReceiveThatOpeningNotificationNow" that would queue the notification when the js size is all ready.
The text was updated successfully, but these errors were encountered: