Push notification, When?
Hi Jeff,
Yes, here you go:
http://docs.appery.io/tutorials/sendi...
http://docs.appery.io/documentation/b...
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi Jeff,
Yes, here you go:
http://docs.appery.io/tutorials/sendi...
http://docs.appery.io/documentation/b...
Hello
I want to store codedata.aps.alert/code in localStorage whether the app is running or not.
When user click on notification than I want to open a page that fetch latest info using REST service. I'm sending some id as message and this id is passed to the sevice as request parameter.
Please help me.
Hi Kirit,
On Push Notification event, add Run JavaScript action with the following code:
codelocalStorage.setItem("pushData", data.aps.alert);/code
Then you can use localStorage "pushData" variable in Rest services mappings.
To make the app navigate to another page when a message is received, add Navigate To Page action.
Please note that if iOS app works in the Background, then on the Push Notification click app opens, but the actions aren't executed. It is a known bug. We're working on it. On Android everything works properly.
Hi Folks,
I just encountered this iOS bug with background notifications not executing when the app opens. Any chance of a workaround or update in general?
Thx.
Hello! It's going to be fixed in the next release (early November). This happens because push notification message is added to the pendingNotifications queue, when you launch application by tapping on notification message, when application is inactive. So this issue can be solved in two ways:
1) Manually add 'resume' event handler with next code:
prePushNotification.getPendingNotifications(function(status) {
var notifications = status.notifications;
for (var i = 0; i < notifications.length; ++i) {
// Notification handling - use handler defined by user when application is in active mode.
// User can define another behavior in this case.
PushNotification.notificationCallback(notifications);
}
});/pre
2) Add code specified in item 1 to the code generation module, like this:
predocument.addEventListener("deviceready", function() {
$(document).unbind('pushregistrationfail pushregistrationsuccess push-notification resume ').bind({
// ... other events
"resume": function() {
PushNotification.getPendingNotifications(function(status) {
var notifications = status.notifications;
for (var i = 0; i < notifications.length; ++i) {
PushNotification.notificationCallback(notifications);
}
})
},
});/pre
Android.
To receive push data on launch from gcm notification.
Push Notification events have to be in the start up screen though right?
Otherwise they are not captured if App is not running..?
Hello!
[quote:]Push Notification events have to be in the start up screen[/quote] No
To see that you can download source code for Eclipse project and check that.