Cordova Push Plugin: onNotificationGMC is not fired and cannot obtain regID

前端 未结 3 1102
情书的邮戳
情书的邮戳 2021-01-13 06:01

Hello everyone I\'m developing a cordova Hybrid app that requires the Push Notification Service of Android and iOS to work and so I\'ve installed the cordova plugin \"PushPl

3条回答
  •  Happy的楠姐
    2021-01-13 06:46

    I had the same problem. If you are using AngularJS + IonicFramework you do not have to do this:

    After you create your factory with your onDeviceReady function, creates onNotificationGCM function. Something like this:

    app.factory('PushProcessingService', function () { ..

    });

    function onNotificationGCM(e) { }

    I was creating onNotificationGCM inside my factory. This solve my problem. I hope it can helps you.

提交回复
热议问题