无法使用 ti.cloudpush 钛模块获取设备令牌?

Unable to get device token with ti.cloudpush titanium module?

我尝试使用 4.1.ti.cloudpush 钛模块获取设备令牌。0.GA SDK 与 Appcelerator Studio 4.3.3.

我使用服务器密钥创建了 google API 项目,并使用 GCM API 密钥和 GCM 发件人 ID 在我的 appcelerator 帐户中配置了 ArrowDB。

在 tiapp.xml 文件中设置以下行。

<property name="acs-oauth-secret-development" type="string">xxxxxxx</property>
<property name="acs-oauth-key-development" type="string">xxxxxxx</property>
<property name="acs-api-key-development" type="string">xxxxxxx</property>
<property name="acs-push-type-development" type="string">gcm</property>
<property name="acs-push-type-production" type="string">gcm</property>
<property name="acs-push-type" type="string">gcm</property>

但是我收到以下消息..

[WARN] :   W/com.appcelerator.aps.CCPushService: Getting GCM SenderId failed. No response area in returned JSON. Will try again in 5 seconds.
[WARN] :   W/com.appcelerator.aps.CCPushService: Device Token is null.

因此,如果我遗漏了任何要为 cloudpush 配置的内容,请告诉我。

如果您的 GCM 发件人 ID 在 ArrowDB 中配置不正确,则会发生此错误。确保正确遵循以下说明。

  1. 转到https://platform.appcelerator.com/
  2. 在应用程序中/在那里搜索您的应用程序名称并打开它。
  3. 点击左边的箭头,应用名称出现在右边select应用名称。
  4. 这在 ArrowDB 门户中,转到左侧的推送通知。在左上角的右侧 select 您的环境,对于您的情况,它是开发。
  5. 现在在 Android 推送选项卡中。确保 GCM API 密钥和 GCM 发件人 ID 在那里,然后单击保存按钮。

这应该适合你。还要确保您在 ArrowDB 中创建了一个用户,并且在 tiapp.xml.

中配置了 cloudpush 模块