PhoneGap Build Push Notification (Android)

后端 未结 2 2074
星月不相逢
星月不相逢 2020-12-16 21:54

I am having trouble receiving any type of callback for the push notifications plugin for phonegap build, I have included the plugin inside config.xml.

I have signed

2条回答
  •  庸人自扰
    2020-12-16 22:56

    I think I've found the solution.

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

    Doesnt work

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

    DOES work

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

提交回复
热议问题