【问题标题】:Post event not working on PushWoosh cordova SDK发布事件不适用于 PushWoosh cordova SDK
【发布时间】:2018-10-04 16:39:11
【问题描述】:

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

docs 中有一个 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)。

有什么想法吗? 先谢谢了!!

【问题讨论】:

    标签: android cordova ionic-framework cordova-plugins pushwoosh


    【解决方案1】:

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

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

    文档似乎已经过时了。

    【讨论】:

      猜你喜欢
      • 2021-12-24
      • 1970-01-01
      • 2016-08-10
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2014-10-30
      • 1970-01-01
      • 2018-11-04
      相关资源
      最近更新 更多