Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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.

Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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

Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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.

Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

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.

Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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.

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

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

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.

Josiah South
Posts: 0
Joined: Mon Aug 11, 2014 2:15 pm

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

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

Return to “Issues”