在android的telerik推送通知中获取错误

时间:2016-11-01 04:11:03

标签: android push-notification telerik

我正在尝试使用telerik平台为我的混合应用程序实现推送通知。它适用于iOS。但在android中,它收到错误 - “推送通知当前正在初始化”。 这是我用过的代码。

app.everlive = new Everlive({
  appId: "xxxxxxx",
  scheme: 'http'
});
var enablePushNotifications = function() {
  var devicePushSettings = {
    iOS: {
        badge: 'true',
        sound: 'true',
        alert: 'true'
    },
    android: {
        senderID: 'xxxxxxx'
    },
    wp8: {
        channelName: 'EverlivePushChannel'
    },
    notificationCallbackIOS: onPushNotificationReceived,
    notificationCallbackAndroid: onPushNotificationReceived,
    notificationCallbackWP8: onPushNotificationReceived
  };
app.everlive.push.currentDevice().enableNotifications(devicePushSettings,     successCallback, errorCallback);
 function onPushNotificationReceived(e) {
    alert(JSON.stringify(e));
};

function successCallback(e) {
    app.everlive.push.register(devicePushSettings, function() {
        alert("Successful registration in Backend Services. You are ready to receive push notifications.");
    }, function(err) {
        alert("Error: " + err.message);
    });
    alert(JSON.stringify(e));
};

function errorCallback(e) {
    alert(JSON.stringify(e));
  };
};

它会转到errorCallback。有人可以帮我解决这个问题吗?提前致谢。

0 个答案:

没有答案