How to tell app was started by tapping push message notification

与世无争的帅哥 提交于 2019-12-06 09:55:06

In a pure Native application, you can know "where from the user opened the app", meaning whether it was by tapping on a received notification or by tapping the application icon.

In a Worklight-based Hybrid application, and if using only the JavaScript API, this is not feasible because all paths arrive to the same destination which is the pushNotificationReceived function. So whether you tapped a notification or the app icon or brought the app to the foreground, the aforementioned function will be invoked.


The solution may be to base your implementation on the following Knowledge Center documentation topic: Using native and JavaScript push APIs in the same app.

This way, using a combination of native code and JS code, you could handle the scenario where a notification was received but the user decided to tap the application icon rather than the notification.

An end-to-end example would to somewhat involved to implement, but if you'll follow the code examples in the documentation topic, you should get there...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!