0

I have developed an mobile app with push notification using IBM Worklight 6.1. I am mainly concentrating on Android and IOS. I can able to send and receive the push notification even when the app is closed. After receiving the push notification, when i am opening it, the app launching with the default page. Now my question is Is there a way to launch a particular page when opening the received push notification using hybrid way?

sasi
  • 512
  • 4
  • 27
  • You will need to better define what do you mean by "another page"? Are you using jQM and have a multi-page app? What is your implementation type in regards to "page"? – Idan Adar Jun 03 '14 at 12:03
  • Yes.I am using Jquery Mobile and i have multiple pages. Lets say, normally when starting the app the home page will appear. I have a separate page to display all the notifications. Now when i am receiving the notification when the app is closed. I will click on the notification which will open the app automatically. Now i need to show the notification page instead of Home Page. – sasi Jun 03 '14 at 13:43
  • 1
    Assuming you are following the PushNotifications sample project, you can add a changePage function inside pushNotificationReceived(). Have you tried that? – Idan Adar Jun 03 '14 at 13:45
  • We can go to the notification page, when the app is running on foreground and background. But unable to move to next page if the app is not running on background. – sasi Apr 08 '15 at 11:27
  • See the answer that I have posted. – Idan Adar Apr 08 '15 at 11:36
  • @IdanAdar, as I explained earlier I can navigate to the notification page when the app is in Background/Foreground. If the app activity is closed, onclick of received notification, the app home page is displayed. Instead, the notification page should be displayed. – sasi Apr 08 '15 at 12:22
  • So again, review my implementation in my answer. The app is *closed*. You tap a notification and the app then opens up. Upon receiving the notification you can decide how to handle it - move to another page or not. Test my implementation (in a new app not in yours) - see how it works, then implement it in yours. It does whaty ou want it to do. – Idan Adar Apr 08 '15 at 12:24

1 Answers1

0

Yes, it is possible for you to "change page" based on the received notification.
I describe one possible implementation to do so in my answer, here: https://stackoverflow.com/a/25604731/1530814

You should review it and alter it for your needs.

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89