Anim
Posts: 0
Joined: Fri Jul 03, 2015 10:45 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

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:

  1. Push notification received, tap on it, it opens the App. However push notification event is not triggered (alert on the event is not running).

  2. I send the App to the background, open another App, or go to iOS home page, and nothing occurs.

  3. 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.

Anim
Posts: 0
Joined: Fri Jul 03, 2015 10:45 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

Hi,

Any updates on this?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

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.

Anim
Posts: 0
Joined: Fri Jul 03, 2015 10:45 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

Hi Alena,

The, PUSH NOTIFICATION event is not triggered when APP is killed.
My sequence goes as below:

  1. App is killed and not running on background

  2. 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.

  3. 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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

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.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

data.aps.alert is not fetching Push Payload when APP is killed for iOS

Anime, would you be so kind to show me the Javascript you are using to fetch the Payload ?

Thanks

Addy

Anim
Posts: 0
Joined: Fri Jul 03, 2015 10:45 am

data.aps.alert is not fetching Push Payload when APP is killed for iOS

codevar message = data.aps.alert;/code
This is used under Push Notification Event

Return to “Issues”