1
votes

I have some questions related to Push Notification in Worklight:

  1. If push notification is received when the app is in background or closed, it will be displayed in notification bars. When the notification message is clicked, it will be directed to the homepage of the app. May I know if it is possible to switch to other pages instead of homepage?

  2. When the app is closed and the notification message arrives, I launch the app by clicking the app icon instead of message in notification bar, it seems to me I cannot get back the notification message in the app. (There is no problem when the app is running in background)
    Steps:
    a) Subscribe to an event source inside the app
    b) Close the app
    c) Submit notification ("Hello") to the device
    d) In the app, notification message ("Hello") is displayed in the status bar. Slide down the status bar. The message is displayed in Notification bar.
    e) Do not click the notification bar to enter to the app. Instead, click the app icon (which is the normal way to get into the app).
    Result: It seems that pushNotificationReceived is not invoked and thus I cannot get back the notification inside the app.
    Thanks a lot!!

Details:
Worklight 5.0.6
Android version 4.1.1 (Samsung Galaxy S3)

1

1 Answers

1
votes

Regarding the first question: Considering Worklight a single-page application, you cannot direct to different HTML pages as you will lose the context to Worklight.

That said, if you are using jQuery's pages and fragments approach, MAYBE what you could do is pass a certain value in the payload and in pushNotificationReceived (I am basing this on the push notifications sample app), you could do some JavaScript magic to load specific content based on the payload...

Regarding the second question: please edit your post with more detailed reproduction steps.