android - 是否可以在设备上没有 Google 帐户和 Google Play 服务的情况下使用 GCM?

标签 android push-notification google-cloud-messaging google-play-services google-account

我正在为具有
的设备编写系统应用程序 未安装 Google Play 服务或 Google Play 商店。

我想实现推送通知。

该设备运行的是 Android 4.2.2,官方 Google GCM 文档说:

A Google account is not a requirement on devices running Android 4.0.4 or higher.

但这些文档与使用 Google Play Services 的新版 GCM 有关(我不适合)

所以我尝试使用旧的、已弃用的 GCM 帮助程序库。
我在设备上安装了 GoogleServicesFramework4.0.x(我可以安装 GSF,但不能安装 Google Play 服务)

我现在收到 AUTHENTICATION_FAILED 错误并且 registrationId 为 null
我猜这是因为设备上没有设置 Google 帐户。
已弃用的 GCM 库是否需要 Google 帐户?
(我的 SENDER_ID 是正确的,我已经检查过了)


基本上,我的问题是:
没有 Google 帐户是否可以使 GCM 工作,
使用旧的、已弃用的 GCM 帮助程序库?

NOTE: I mustn't create Google account on the device (this is a requirement)

如果这不可能,那么请建议另一种实现推送通知的方法。
(请注意,大多数推送通知提供商实际上“在幕后”使用 GCM(例如,Urban Airpush),所以不要推荐这些)

如果可能的话,我想避免轮询服务器以获取通知(“拉取通知”),
谢谢。

最佳答案

就在您发布报价之前(关于不需要 Google 帐户),您有这个:

It requires devices running Android 2.2 or higher that also have the Google Play Store application installed, or or an emulator running Android 2.2 with Google APIs. However, you are not limited to deploying your Android applications through Google Play Store.

因此,Google Play Store 似乎是 GCM 工作所必需的。

我无法为您提供 GCM 的替代方案。

关于android - 是否可以在设备上没有 Google 帐户和 Google Play 服务的情况下使用 GCM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21336808/

相关文章:

android - 如何强制设备获取新的 GCM ID?

Android:为什么我不应该在选项卡内使用 Activity ?

android - TYPE_ROTATION_VECTOR 的传感器值在不同设备上不相同

iphone - 当推送通知出现时,如果用户单击应用程序图标而不是单击通知来打开此应用程序

azure - 单个通知中心可以处理多种类型的通知吗?

android - GCM 广播接收器

android - 位图太大

java - 如何从用于 addValueEventListener 的 for 循环内的查询获取字符串值

c# - MVVM 灯 - 推送通知

ios - Firebase 云消息传递开发和发布配置文件