Ionic-native: [BUG] No Provider for Push!

Created on 21 Mar 2017  路  5Comments  路  Source: ionic-team/ionic-native

Hi there

I upgraded to the Ionic Native 3 stuff according to the blog-entry.

Now I'm constantly getting the error "No provider for push!" When running the app.

The relevant code is:

import {Push, PushObject, PushOptions, NotificationEventResponse, RegistrationEventResponse} from '@ionic-native/push';
// ... some boilerplate stuff here ...
export class NotificationService {
// ... some boilerplate stuff here ...

    constructor(private platform: Platform,
                private push: Push) { // <------
        console.log('Hello NotificationService Provider');
    }

// ... some boilerplate stuff here ...

}

The data from the ionic error window:

  • Ionic Framework: 2.2.0
  • Ionic App Scripts: 1.1.4
  • Angular Core: 2.4.8
  • Angular Compiler CLI: 2.4.8
  • Node: 7.3.0
  • OS Platform: macOS Sierra
  • Navigator Platform: Iphone

I'm using the WKWebView. But I don't think that's relevant, because if i'm switching it off it still doesn't work.

I don't use the ionic cloud services.

Keep up the good work! Really appreciate it

Most helpful comment

Make sure to add Push to your providers in app.module.ts:

import { Push } from '@ionic-native/push';

// ...

providers: [ Push ]

See example at the bottom here: http://ionicframework.com/docs/v2/native/

All 5 comments

Make sure to add Push to your providers in app.module.ts:

import { Push } from '@ionic-native/push';

// ...

providers: [ Push ]

See example at the bottom here: http://ionicframework.com/docs/v2/native/

Maybe worth mentioning that this should be done for all plugin providers. I didn't find it mentioned in the native doc pages.

Heh, Chrome was displaying the old cached version of the page...A hard reload did the trick. Talk about trusting your browser these days

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaliko picture shaliko  路  3Comments

sabariferin picture sabariferin  路  4Comments

GunaSekhar1 picture GunaSekhar1  路  4Comments

rajanshahsa picture rajanshahsa  路  3Comments

jgw96 picture jgw96  路  3Comments