发布事件在 PushWoosh cordova SDK 上不起作用



我正在尝试将事件从我的Ionic应用程序发布到PushWoosh以显示应用内消息,但它不起作用。

在文档中有一个Javascript示例。我尝试过:

pushNotification.postEvent(JSON.stringify({
"event": "Test event",
"attributes": {
"test": true,
},
"success": successCallback, // optional
"error": errorCallback // optional
}));

但不会触发该事件。

我查看了插件文件,界面对该方法的使用有不同的看法:

//Function: postEvent
//[android, ios] Post events for In-App Messages. This can trigger In-App message display as specified in Pushwoosh Control Panel.
//
//Parameters:
// "event" - event to trigger
// "attributes" - object with additional event attributes
// 
// Example:
//(start code)
// pushwoosh.setUserId("XXXXXX");
// pushwoosh.postEvent("buttonPressed", { "buttonNumber" : 4, "buttonLabel" : "banner" });
//(end)
PushNotification.prototype.postEvent = function(event, attributes) {
exec(null, null, "PushNotification", "postEvent", [event, attributes]);
};

正因为如此,我尝试了:

pushNotification.postEvent('Test event', {
"test": true
});

但它也不起作用。

因此,该应用程序正在注册设备,推送通知也可以正常工作,但我无法推送事件。 (在仪表板中,触发器计数为 0(。

有什么想法吗? 提前谢谢!!

我创建了一个新的免费帐户(免费试用版(,因为我的个人帐户是不久前创建的,并以界面中指定的形式使用postEvent方法:

pushNotification.postEvent('Test event', {
"test": true
});

文档似乎已经过时了。

最新更新