如何在 Appcelerator Titanium 仪表板中配置 Android 推送通知 (GCM)?

How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?

我已尝试按照说明进行操作

Configuring push services for Android devices

然而,步骤中提到 'Click Push Notifications on the left-side navigation' 但它们并不存在...

Once you've created a Google API project with GCM enabled, you need to update your application's settings page in Dashboard with the API key and sender ID you generated.

To configure Arrow for push notifications using Dashboard:

Open Dashboard and select your application from the Apps drop-down menu.

Click Push Notifications on the left-side navigation <-- MISSING.

Select the Android Push tab.

Enter the server key in the GCM API Key field and the GCM sender ID in the GCM Sender ID field.

这是显示所列内容的屏幕截图...

如果我在箭头下查看(我怀疑它可能会被列出)那是空的(我没有使用箭头 - 我认为它是一个替代 UI 使用声明 XML )...

我检查了我的订阅(独立),它表明我应该能够免费发送多达 100 万条推送通知..

有谁知道如何将 Appcelerator Titanium 项目关联到 GCM 服务器密钥?

此外,当我查看 Google 的开发者控制台时,我的应用程序(在他们的应用程序商店上运行)没有列出,所以我创建了一个 新应用程序 称为 'Gcm'。 Appcelerator Titanium 似乎确认我需要 'create' 应用程序,我只是太担心了,无法将其命名为与实时应用程序相同的名称。 'Google Developer Console' 应用程序与 'Google Play' 应用程序有什么关系?! - 如果有的话?

更新

我刚刚在 TiApp.xml 中发现我可以启用一些 'Cloud' 设置并且这已经解锁了 'Push' 菜单 - 所以我认为现在一切都很好,有人可以确认这是正确的做法并回答我关于 Google 播放应用程序 v google 开发者控制台应用程序的相关问题?

更新 2

我开始遇到这个错误

[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. [INFO] : CloudPush.retrieveDeviceToken error: INVALID_SENDER

我只是打电话来尝试注册 Android 推送通知 ...

CloudPush.retrieveDeviceToken({
                success : function(e) {
                    console.info("CloudPush.retrieveDeviceToken success");
                },
                error : function(e) {
                    console.info("CloudPush.retrieveDeviceToken error:"+e.error);
                }
            });

我试过使用和不使用 ti.cloud 模块(我认为它是在我单击 'Enable Services' 按钮时添加的,这意味着我可以看到 'Push Notifications' 选项卡,但是它似乎仍然列出了 ti.cloud 模块是否被选中)..

之前..

Q - 如何停止 Google 播放错误并检索设备令牌(奇怪的是,我在启用服务之前获得了令牌。

问 - ti.cloud 是否用于接收推送通知,或者 ti.cloud推送是否足够?

您可以忽略 Google 播放服务错误,但您的 GCM 发件人 ID and/or API 密钥似乎有误。通读教程并确保您记下了正确的内容。

如果您使用 Appcelerator 云服务发送推送通知,您需要ti.cloud注册设备。

要获取设备令牌并接收推送通知,请使用 ti.cloudpush。您可以使用其他模块代替 ti.cloudpush。

感谢您提出详细的问题 :) 让我谈谈您提到的一些事情,并尽我所能澄清一下。

If I look under Arrow (where I suspect it might be expecting to be listed) that's empty

正如您后来发现的,您必须为您的应用程序启用平台服务,这将创建一个与您的应用程序同名的 ArrowDB 应用程序。此应用程序将在侧边栏中配置推送通知。我已经 updated 指南的措辞来明确我们指的是 ArrowDB 应用程序,而不是 Titanium 应用程序。

(I'm not using Arrow - I thought it was an alternative UI using declarative XML)...

不要将 Arrow 与 Alloy 混淆 - 这是 Titanium 的 MVC 框架,它确实使用了 XML.

How does the 'Google Developer Console' Application relate to the 'Google Play' application?! - if at all?

没有。您甚至可以让多个应用共享同一个 GCM 发件人。

[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found.

你用什么测试的?也许没有安装 Google 应用程序的 Genymotion 模拟器?你会需要的。

Is ti.cloud used to receive the push notification, or is ti.cloudpush sufficient for this?

ti.cloud 是与 ArrowDB 通信、订阅频道等的模块。在 Android 上,您需要 ti.cloudpush(或@Shawn 提到的另一个模块)来检索设备令牌,在 iOS 上,您可以使用 Ti. API .按照 this guide 执行所有步骤。