且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PhoneGap 构建推送通知 (Android)

更新时间:2023-02-26 22:01:18

我想我已经找到了解决方案.

I think I've found the solution.

我为对象中的属性 senderID 传递了一个整数而不是字符串

I was passing an integer instead of a string for the property senderID in the object

不起作用

pushNotification.register( 
    function(){alert('Push: win');}, // NOT called
    function(){alert('Push: Error');},  // NOT called
    { senderID: 123456789, ecb: "app.push_android" }
);

有效

pushNotification.register( 
    function(){alert('Push: win');}, // called
    function(){alert('Push: Error');},  // called
    { senderID: "123456789", ecb: "app.push_android" }
);