我已经使用 IONIC 1 构建了一个应用程序,并使用clevertap 进行分析和推送通知。我正在使用官方的 cordova 插件来使用 CLEVERTAP 推送通知,
对于android它工作正常,但对于IOS它不工作。谁能帮我这个?
这里是示例初始化代码,
var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
document.addEventListener('onCleverTapProfileSync', this.onCleverTapProfileSync, false);
document.addEventListener('onCleverTapProfileDidInitialize', this.onCleverTapProfileDidInitialize, false);
document.addEventListener('onCleverTapInAppNotificationDismissed', this.onCleverTapInAppNotificationDismissed, false);
document.addEventListener('onDeepLink', this.onDeepLink, false);
document.addEventListener('onPushNotification', this.onPushNotification, false);
},
onDeviceReady: function() {
app.receivedEvent('deviceready');
$rootScope.CleverTap = CleverTap;
CleverTap.notifyDeviceReady();
CleverTap.registerPush();
},
onCleverTapProfileSync: function(e) {
console.log(e.updates);
},
onCleverTapProfileDidInitialize: function(e) {
console.log(e.CleverTapID);
},
onCleverTapInAppNotificationDismissed: function(e) {
console.log(e.extras);
console.log(e.actionExtras);
},
onDeepLink: function(e) {
console.log(e.deeplink);
},
onPushNotification: function(e) {
console.log(JSON.stringify(e.notification));
},
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
console.log('parseElement', parentElement, id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}};app.initialize();