She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Page show with setTimeout vs. Push Notification recevied and run a service

Hi Team,
How can i handle an event? i have a pageshow event and there's a code inside which has a setTimeout to navigate to the next page: the code is in below:
code
var AC = localStorage.getItem("regID");
var pushNotif = localStorage.getItem("UniqueDevID");
if ((!.isEmpty(AC))&&!.isEmpty(pushNotif)){
setTimeout(function()
{navigateTo ('MainMenu');},10000);
}else
{
setTimeout(function()
{navigateTo ('startScreen');},10000);
}

/code
and i have another event which is push Notification: this event is running a service everytime i recieved a push notification:

screenshot of 2 events in 1 page:
https://d2r1vs3d9006ap.cloudfront.net...

everytime i received a push notification. it runs the service and navigate to the page i needed. but after a sec it navigate to the MainMenu Page which is in page show event javascript code?
how can i handle it correctly? when i didnt receive a notification the pageshow event will run. and when i receive a push notification, the push notification event will run.

Thanks in advance,
She

Return to “Issues”