0
我已經使用IONIC 1構建了一個應用程序,並使用clevertap進行分析和推送通知。我使用的是官方科爾多瓦插件消耗CLEVERTAP推送通知,Clevertap for IONIC推送通知不適用於IOS
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();
我已經添加了推送通知初始化的示例代碼。讓我知道。 – NitinD
您是否也設置了APNs證書? –
是的,我做到了。沒有這一點,您無法註冊以在Clevertap上推送通知。 – NitinD