0

我尝试使用4.1.0.GA sdk与Appcelerator Studio 4.3.3一起使用ti.cloudpush模块获取设备令牌。无法使用ti.cloudpush钛金模块获取设备令牌?

我创建了带有服务器密钥的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。

回答

1

如果您的GCM发件人ID在ArrowDB中未正确配置,则会发生此错误。确保你按照下面的指示正确。

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

这应该适合你。确保你的用户已经在你的ArrowDB中创建了,并且在你的tiapp.xml中配置了cloudpush模块。

+1

谢谢你......它的工作。我之前已经这样做了,但之后我更改了我的GCM API密钥并开始工作。 :) –