gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:57:12 26 4
gpt4 key购买 nike

我正在为具有
的设备编写系统应用程序未安装 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/

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