Ionic 2 rc.3 Push Notification TypeError: push.then is not


#1

Hello!!!

import { Push } from 'ionic-native';

let push = Push.init({
         android: {
             senderID: 'xxxxxxxxxxxxxx'
         },
         ios: {
             alert: 'true',
             badge: true,
             sound: 'false'
         },
         windows: {}


      });

push.on('registration', (data) => {
    console.log(data.registrationId);
});

ionic serve ->

\C:\Users\Admin.MFC\Desktop\publikun\node_modules@angular\core\src\error_handler.js:48 EXCEPTION: Uncaught (in promise): TypeError: _this.push.then is not a

please help me
thansk


#2

I have same issue it’s giving error

Uncaught (in promise): TypeError: push.on is not a function

Error: Uncaught (in promise): TypeError: push.on is not a function
    at s (http://localhost:8100/build/polyfills.js:3:8568)
    at http://localhost:8100/build/polyfills.js:3:8940
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:14051)
    at Object.onInvokeTask (\G:\xampp\htdocs\IO2RC3\MyApp\node_modules\@angular\core\src\zone\ng_zone.js:229:37)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:13987)
    at e.runTask (http://localhost:8100/build/polyfills.js:3:11411)
    at i (http://localhost:8100/build/polyfills.js:3:8028)
    at HTMLDocument.invoke (http://localhost:8100/build/polyfills.js:3:15204)

#3

Maybe this tutorial can help https://medium.com/@ankushaggarwal/push-notifications-in-ionic-2-658461108c59