【问题标题】:What to put in sender.send - Google Cloud Messaging for Android在 sender.send 中放置什么 - 适用于 Android 的 Google Cloud Messaging
【发布时间】:2013-01-13 08:49:59
【问题描述】:

我不明白变量registrationId应该是什么

registrationId=?
Result result = sender.send(message, registrationId, 5);

谁能给我解释一下?

【问题讨论】:

    标签: java android cordova push-notification google-cloud-messaging


    【解决方案1】:

    什么是registrationId

    Google Doc 说:“一个由 GCM 服务器发给 Android 应用程序的 ID,允许它接收消息。一旦 Android 应用程序有了注册 ID,它就会将它发送到使用它的 3rd 方应用程序服务器识别已注册接收给定 Android 应用程序消息的每台设备。换句话说,注册 ID 与运行在特定设备上的特定 Android 应用程序相关联。"

    您可以将registrationId 视为特定于设备的device token,是设备的唯一标识。此唯一标识令牌或registrationId 将帮助您仅将message 发送到指定设备。

    当您从android app 注册GCM 服务时,注册过程会返回这个唯一的ID,称为`registrationId。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 2015-11-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多