php - 使用 OAuth2.0 的 C2DM 和 PHP(不推荐使用 ClientLogin!)

标签 php android push-notification oauth-2.0 android-c2dm

注意:在您花时间阅读之前,请知道 C2DM 本身现在已被弃用并被 GCM 取代 (http://developer.android.com/guide/google/gcm/c2dm.html)

-- 原始问题 --

我们是否有实现 PHP 服务器端代码以使用 C2DM 将消息推送到 Android 设备的示例代码?

我搜索了许多代码示例,这些示例使用的是已弃用的旧身份验证方法 ClientLogin。 引用:https://developers.google.com/accounts/docs/AuthForInstalledApps (重要提示:ClientLogin 已于 2012 年 4 月 20 日正式弃用。它将根据我们的弃用政策继续工作,但我们鼓励您尽快迁移到 OAuth 2.0。)

最佳答案

这不适用于 C2DM,因为它是一个托管帐户,如果您看到 https://developers.google.com/accounts/docs/AuthForInstalledApps它说

ClientLogin can be used to authorize access to both Google regular and hosted accounts. A hosted account is a user account that is part of the Google Apps service.

此外,如果您看到图形是用户之间作为 UI 界面的清晰交互,因为涉及验证码。

enter image description here

编辑

顺便说一句,您可以从这篇文章中看到 C2DM 机制仍将使用 ClientLogin,但是 2011 年 10 月之前的 key 将过期,因此您需要重新创建它们。这是 ClientLogin 被弃用前 8 天的最新帖子。 C2DM Client Login Key

关于php - 使用 OAuth2.0 的 C2DM 和 PHP(不推荐使用 ClientLogin!),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10340005/

相关文章:

带有后处理的Android方形视频记录

ios - 我应该如何处理通过多个 channel 分发的应用程序的推送通知?

android - GCM 推送通知未恢复

php - 验证错误消息

安卓 : How to disable Keyboard or making enable only the numeric in EditText onClick

java - 在解析期间访问 JSON 数据中的键时,For 循环未完成

ios - 当 App 从后台收到推送通知或在 iOS 中终止时,无法收听来自 NSNotificationCenter 的通知

php - 将色调分类为最短跨度的算法,例如 `350,354,2,10,15` ? [0-360度]

php - MySQL UTF-8 字符插入问题

php - 使用 GD 调整图像大小并将图像裁剪为白色背景的正方形