【问题标题】:Phonegap Push Notification redirect to specific page in the application when clicking单击时,Phonegap 推送通知重定向到应用程序中的特定页面
【发布时间】:2014-09-12 09:47:17
【问题描述】:

使用Phonegap Push Notifications Plugin为IOS和Android构建一个移动应用程序,当用户点击它时,如何让收到的通知重定向或转发到应用程序中的特定页面?即当收到通知时,用户必须打开它才能看到它,我们需要将应用程序转发到特定页面,如notifications.html?id=USER_ID?

是否可以通过推送消息发送参数USER_ID,在这种情况下可以解决问题...

感谢您的建议...

【问题讨论】:

    标签: push-notification phonegap-build forward


    【解决方案1】:

    当您从服务器发送推送通知时,包含一个额外的值名称id

    收到通知后,使用localStorage.setItem 保存此“额外值”id 的值。

    然后在onresume事件内部使用localStorage.getItem读取这个id的值,并根据值使用$.mobile.changePage( ...);打开相应的页面

    查看详情:

    https://github.com/phonegap-build/PushPlugin/issues/213

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-22
      • 2012-09-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多