Dav*_*eye 2 android push-notification cordova google-cloud-messaging phonegap-pushplugin
我正在我的cordova应用程序中实施Google Cloud Messaging服务.到目前为止一切运作良好.然而,我有一些问题困扰我希望有人可以为我澄清它们.1)在代码的这一部分,我获取设备GCM regID并进一步将其保存到我的服务器上.我想知道是否应该调用此脚本,从而在用户打开应用程序时将GCM regID保存到我的服务器,或者应该调用并保存一次.
function onNotification(e) {
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
console.log("regID = " + e.regid);
}
break;
}
}
Run Code Online (Sandbox Code Playgroud)
2)我在控制台上注意到我的注册ID有时会发生变化.我想知道为什么会发生这种情况,是否正常以及我是否应该在我的服务器上更新用户GCM regID.
如果有人能为我澄清这些,我会很高兴的.谢谢
| 归档时间: |
|
| 查看次数: |
1705 次 |
| 最近记录: |