1

背景:我正在使用 Jquery、HTML5 和 PHP 开发一个 webapp,并且我使用 webview 创建了 Android Wrapper 应用程序,以将我的 webapp 链接为 android 应用程序。

目标:我想为包装应用程序使用推送通知,以便我可以通知目标用户有关更新或新闻的信息。

问题:我可以使用名为 PARSE 的第 3 方推送通知 API 获取手机的设备 ID/注册 ID,但我想将该设备 ID/注册 ID 链接到我的 Web 应用程序的登录用户。

我的想法是将 deviceid/registrationid 保存在 android 的公共存储中,当用户登录到我的 web 应用程序时,获取该公共存储的设备 ID 并保存在会话中以使用它来发送推送通知。

问题: 1. 无论如何我可以将 deviceid/registrationid 链接到用户登录吗?2.是否有一个公共存储(如localstorage)可以保存id然后webapp可以从那里获取?

提前感谢您的帮助。

4

1 回答 1

0

根据我的理解,您希望通过用户身份验证作为其设备的 ID 来访问您的后端数据库。

         If so then you can achieve it as " Initially when you are 
  calling push notification function and register device for 
  push notification service at that time you casn store that 
  device id in your local database also as user id.


       So whenever user will start your application and 
  it will register device for push notification you just 
  need to check weather that device id is available or 
  not (As if user re install app) and insert in database.

希望你能明白我想说的......

于 2013-10-12T10:51:25.603 回答