是否可以在设备上没有 Google 帐户和 Google Play 服务的情况下使用 GCM? [英] Is it possible to use GCM without Google account AND Google Play Services on the device?

本文介绍了是否可以在设备上没有 Google 帐户和 Google Play 服务的情况下使用 GCM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm writing a system app for a device that has
no Google Play Services nor Google Play Store installed.

我想实现推送通知.

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

The device is running Android 4.2.2 and official Google GCM docs say:

运行 Android 4.0.4 或更高版本的设备不需要 Google 帐户.

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

但这些文档与使用 Google Play Services 的新版 GCM 相关(对我来说不是一个选项)

But these docs are related to the new version of GCM which uses Google Play Services (not an option for me)

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

So I tried using the old, deprecated GCM helper library.
I installed GoogleServicesFramework4.0.x on the device (I can install GSF. but not Google Play Services)

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

I am now getting the AUTHENTICATION_FAILED error and registrationId is null.
I am guessing this is because no Google account is set up on the device.
Does the deprecated GCM library require Google account?
(My SENDER_ID is correct, I already checked that)

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

Basically, my question is:
Is it possible to make GCM work without Google account,
using the old, deprecated GCM helper library?

注意:我不能在设备上创建 Google 帐户(这是要求)

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

如果这是不可能的,那么请建议另一种实现推送通知的方式.
(请注意,大多数推送通知提供商实际上在幕后"中使用 GCM(例如,Urban Airpush),因此不建议使用这些)

If this is not possible, then please suggest another way of implementing push notifications.
(Note that most of the push notifications providers actually use GCM "under the hood" (Urban Airpush, for example), so don't suggest those)

如果可能,我想避免轮询服务器以获取通知(拉取通知"),
谢谢.

I would like to avoid having to poll server for notifications ("pull notifications") if possible,
thank you.

推荐答案

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

Just prior to the quote you posted (about Google account not being required), you have this :

它需要运行 Android 2.2 或更高版本的设备还安装了 Google Play Store 应用程序,或者运行带有 Google API 的 Android 2.2 的模拟器.但是,您不仅限于通过 Google Play 商店部署您的 Android 应用程序.

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 工作的必备条件.

Therefore it seems Google Play Store is a must for GCM to work.

Pushy 是 GCM 的替代方案,不需要 Google 帐户或 Google Play 服务.

Pushy is an alternative to GCM that does not require a Google account nor Google Play Services.

这篇关于是否可以在设备上没有 Google 帐户和 Google Play 服务的情况下使用 GCM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆