Page 1 of 1
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Fri Jul 31, 2015 2:21 am
by Anim
Hi,
We have written a javaScript on my Login Page which runs on "PUSH NOTIFICATION " event and performs
codevar msg = data.aps.alert; /code
This event works fine when the APP is running but when the APP is killed and a PUSH is received codevar msg = data.aps.alert; /code is not fetching payload(Push Notification Event was not triggered, testing using alert() in Push Notification Event).
However, if I receive push notification and open the APP, and then send it back to background, and then open the App again, push notification event is triggered. So the scenario of iOS as follows when the App is killed:
Push notification received, tap on it, it opens the App. However push notification event is not triggered (alert on the event is not running).
I send the App to the background, open another App, or go to iOS home page, and nothing occurs.
After a while, or immediately, I bring the App up again, 'Push notification' is triggered and the alert is displayed.
As we are using push notification event to redirect the navigation into various pages, this is causing us problem. We cannot read the notification payload to identify to which page the App will be redirected.
The problem is only with iOS, Android works fine.
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Thu Aug 06, 2015 6:09 am
by Anim
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Fri Aug 07, 2015 11:00 am
by Alena Prykhodko
Hi Anim,
Unfortunately, I'm not an expert here.
You will need to figure out how data.aps.alert is working for iOS.
Whether it's suitable for your case.
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Fri Aug 07, 2015 11:36 am
by Anim
Hi Alena,
The, PUSH NOTIFICATION event is not triggered when APP is killed.
My sequence goes as below:
App is killed and not running on background
I receive is PUSH, I tap the message in the notification tray, it redirects me to the APP, alert() written under PUSH NOTIFICATION event is not triggered.
If I put the APP in the background and then again open the APP, PUSH NOTIFICATION events is triggered and my alert() works.
data.aps.alert is just a part of javaScript written under PUSH NOTIFICATION event.
Hope I am clear in my description.
Anim
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Sat Aug 08, 2015 5:10 am
by Illya Stepanov
Hi Anim -
Possibly this is how it works on iOS platform, when the app is inactive (killed) Push notification event doesn't initializes. And if the app is in the background the event is been initialized.
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Fri Aug 21, 2015 8:03 pm
by Bad Addy
Anime, would you be so kind to show me the Javascript you are using to fetch the Payload ?
Thanks
Addy
data.aps.alert is not fetching Push Payload when APP is killed for iOS
Posted: Mon Aug 24, 2015 11:03 am
by Anim
codevar message = data.aps.alert;/code
This is used under Push Notification Event