Page 2 of 4

Redirect based on push notification

Posted: Fri Sep 06, 2013 7:53 pm
by Joe Clarke

Thanks.


Redirect based on push notification

Posted: Fri Sep 06, 2013 9:00 pm
by Maryna Brodina

Sorry for misunderstanding Joe
[quote:]That doesn't seem to work because data.aps.alert only has something in it if you received the push notification while inside of the application.[/quote] we had this bug and it has been fixed for Android some time ago.. We need to test it again and unfortunately it might take time. Someone will get back as soon as possible with update.

Perhaps there is the same issue with iOS apps.


Redirect based on push notification

Posted: Mon Sep 09, 2013 8:51 am
by Maryna Brodina

Hello! It works on Android device, but there is a bug on iOS devices unfortunately. We'll fix it as soon as possible.


Redirect based on push notification

Posted: Mon Jan 27, 2014 4:35 pm
by Kevin Preston

I would like to take the user directly to a specific page on receipt of a push message. Your suggestion above :-
var pageName = data.aps.alert;
Appery.navigateTo(pageName);

works but it means that the push message, as shown in the initial Android notification, shows the page name which is not very user friendly. I would like the message to show in the notification as usual but still force the user to the specific page. Is this possible?
Also has anyone come up with a way of opening the app directly a push arrives without having to click the notification first?


Redirect based on push notification

Posted: Tue Jan 28, 2014 9:13 am
by Maryna Brodina

Hello!
1) "opening the app directly a push arrives without having to click the notification first" - I don't think it's possible
2) use if or switch to define where to redirect userprevar message = data.aps.alert, pageName = '';
switch(message){
case "My friendly message 1": pageName = "pageName1"; break;
case "My super friendly message 2": pageName = "pageName2"; break;
case "Just friendly message 3": pageName = "pageName3"; break;
}
if (pageName) {
Appery.navigateTo(pageName);
}/pre


Redirect based on push notification

Posted: Tue Jan 28, 2014 10:51 am
by Kevin Preston

Maryna,
Thanks, you've given me some ideas on how to solve my problem.


Redirect based on push notification

Posted: Sat Aug 22, 2015 11:39 am
by A.W.H.

How to automatically push in background? I'm on the standard plan which refreshes code every 15 minutes.


Redirect based on push notification

Posted: Sat Aug 22, 2015 11:41 am
by A.W.H.

This doesn't answer how the reciever of the push notification will call these lines which perform a switch statement according to message type and deeplink location.

Thoughts? Thanks in advance if you would provide sample code/examples.


Redirect based on push notification

Posted: Sat Aug 29, 2015 5:47 am
by Illya Stepanov

You can schedule your push notifications: https://devcenter.appery.io/documenta... or execute a Server side script for sending push messages.


Redirect based on push notification

Posted: Sat Aug 29, 2015 5:50 am
by Illya Stepanov

You can use only JavaScript modification as shown in example above.