【问题标题】:I am getting error i.e Required field: Channel is missing我收到错误,即必填字段:缺少频道
【发布时间】:2014-01-19 15:53:08
【问题描述】:

我正在尝试使用推送通知开发应用程序,我正在获取设备令牌但无法订阅。

我收到错误,即必填字段:缺少频道。

我这样做是为了订阅

var deviceToken;
var CloudPush = require('ti.cloudpush');
var Cloud = require('ti.cloud');
Cloud.PushNotifications.subscribe({
        channel: 'friend_request',
        type: Ti.Platform.name == 'android' ? 'gcm' : 'ios',
        device_token: deviceToken
        }, function (e) {
            if (e.success) {
                alert('Success :'+((e.message) || JSON.stringify(e)));
                pushNotify();
            } else {
                alert('Error:' + ((e.error && e.message) || JSON.stringify(e)));
            }
    });  

【问题讨论】:

    标签: android push-notification titanium


    【解决方案1】:

    @Phil McCarty 提到的任何内容,并确保您是 using GCM 而不是上个月已弃用的 MQTT。完成这些设置后,请确保设备正在发送设备的令牌,因为您将收到相同的 ACS 消息:如果令牌错误,则通道丢失。

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题。如果没有登录 ACS 云服务平台的用户帐户,您似乎无法真正订阅。

      所以要么创建一个帐户,要么使用默认帐户。这是 Appcelerator.com 上的一个帖子,解决了同样的问题,并提供了一个有效的代码示例。

      https://developer.appcelerator.com/question/135641/push-notifications-with-ticloud

      【讨论】:

        猜你喜欢
        • 2022-06-30
        • 1970-01-01
        • 2014-08-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多