gpt4 book ai didi

javascript - GCM 和服务器端相关问题

转载 作者:行者123 更新时间:2023-11-30 03:40:12 27 4
gpt4 key购买 nike

我目前正在使用从 android SDK 下载的 DemoActivity 项目在 android 上试用 GCM。关于整个 GCM 的东西有几个问题。如果我错了,请纠正我。

  1. 根据我的理解,我们需要为 GCM 注册 android 设备的只是 Sender_ID 和 Server_URL? Server_URL 基于我的第 3 方应用程序服务器的 URL,例如 http://localhost:8080/gcm_test。至于 Sender_ID 基本上就是 Google API 的 Project ID。

  2. 我是否需要将注册 ID 从 android 设备发送到服务器端并将其存储在服务器端数据库或类似的东西中?

  3. 为了从服务器向 android 设备发送消息,我们需要 API key 和 android 注册 ID?

  4. 如何在服务器端配置以发送消息?

最佳答案

1)

2)。只要您需要向特定设备发送推送通知,您就需要它。服务器使用注册 ID 识别该设备。

3)需要你创建项目时得到的Google App Id和后台保存的注册Id。

4) For ASP.NET look at this .

string GoogleAppID = "google application id";        
var SENDER_ID = "9999999999";
//......
//......
AndroidGCMPushNotification apnGCM = new AndroidGCMPushNotification();

string strResponse =
apnGCM.SendNotification(devRegId,
"Test Push Notification message ");

关于javascript - GCM 和服务器端相关问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15871037/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com