Page 1 of 2

How is the Push Notification event used? No matter what it does not fire

Posted: Mon Feb 16, 2015 10:11 pm
by Josiah South

I can send notifications just fine, the device is registered just fine and I can use the query builder to select devices which update their channels just fine.

When I use the Push Notification event (on my starting page, my main template or any other page for that matter) and choose to Run Javascript with the code 'alert(data.aps.alert)' or any other code like 'localStorage.setItem('_lastPush', JSON.parse(data.aps.alert))' the events are never fired. When is this event supposed to fire? When the notification is clicked and the app is opened? I have also tried receiving notifications when the app is open on the device to see if any events are triggered.

It seems I just don't know how to use the event (and there seems to be no documentation).

Problem in broader terms: How would I save a push notification in localStorage? The answer to this should answer my question.


How is the Push Notification event used? No matter what it does not fire

Posted: Tue Feb 17, 2015 6:52 am
by Ihor Didevych

Hi Joshian,

Let us know if this helps:
https://getsatisfaction.com/apperyio/...


How is the Push Notification event used? No matter what it does not fire

Posted: Tue Feb 17, 2015 6:55 am
by Josiah South

Yeah that basically says to do exactly what I'm already doing. I posted what I was doing in my question.


How is the Push Notification event used? No matter what it does not fire

Posted: Tue Feb 17, 2015 6:43 pm
by Josiah South

I'll just not worry about this functionality. I don't care that much and getting any real information that isn't in the terrible documentation is like pulling teeth.


How is the Push Notification event used? No matter what it does not fire

Posted: Wed Feb 18, 2015 12:25 pm
by Maryna Brodina

Hello!

Sorry, do I understand you correctly that push is sent successfully, but event inside the app never fires? If so, please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and let us know app name.


How is the Push Notification event used? No matter what it does not fire

Posted: Wed Feb 18, 2015 5:49 pm
by Josiah South

Yes you understand. No I shouldn't need to share my app with support.

I simply asked for documentation on the Push Notification event, I don't want you to magically find and fix my problem I want to know the expected behavior of the Push Notification event within an Appery built app.

As far as I have seen there is none, only an example of using it at the same time as Push Initialize.


How is the Push Notification event used? No matter what it does not fire

Posted: Thu Feb 19, 2015 8:06 am
by Evgene Karachevtsev

Hello Josiah,

The documentation is here:
http://devcenter.appery.io/documentat...
If push event does not work this way, as described in the documentation, you may share the application with support, we'll investigate.


How is the Push Notification event used? No matter what it does not fire

Posted: Thu Feb 19, 2015 4:00 pm
by Josiah South

Push notification - "fires when the device receives a notification."

I have to run around and find a tutorial on Push Notifications to find out what values are sent with the event. I gather that 'data.aps.alert' will contain something, probably the text content from the notification. I wonder what else is in the 'data' object, I wonder what 'aps' is, I wonder what else is sent along with the event.

I can gather form the name of the event that it "fires when the device receives a notification" but that doesn't help me use it at all.


How is the Push Notification event used? No matter what it does not fire

Posted: Tue Feb 24, 2015 11:33 am
by Illya Stepanov

Hi Josiah -

You can use this code:
pre
codeJSON.stringify(data.aps)/code
/pre

  • on the push notifications event.

    There should be notification message and for iOS would be badge.


How is the Push Notification event used? No matter what it does not fire

Posted: Tue Feb 24, 2015 3:03 pm
by Josiah South

Ah this is a typo in the question. I've tried this (the question says JSON.parse but should say strngify)