WARN: Native: tried calling PushNotification.init, but the PushNotification plugin is not installed


#1

Hey all,
Im having this error on iOS: "WARN: Native: tried calling PushNotification.init, but the PushNotification plugin is not installed."
Does Anyone have this issue as well? please need help hehe


Ionic Package app giving error "PushNotification plugin is required"
#2

Obviously you are trying to use PushNotification.init, “but the PushNotification plugin is not installed.”. The error message is quite clear.

What did you install in your app? Ionic Native plugin? Cordova plugin?


#3

I had to update my platforms…

ionic cordova platform update ios
ionic cordova platform update android

and then install again the plugin

sudo ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXX

but now when i tried to build ios, i got this error

build-debug.xcconfig line 27: Unable to find included file “…/pods-debug.xcconfig”

I AM so tired of this … :smile:


#4

That’s a iOS build problem now.

I would remove and re-add the iOS platform first. If the problem persists, run the command with --verbose.


#5

So in the end, i removed the iOS platform then add it again WITHOUT root because I had

Cocoa cannot be installed as root

After that i got error when building and podfile… To make it work, i had to update podfile

pod repo remove master
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod setup

and then

pod install

I had to do that because of the plugin push i think.
Right now Im still having a issue when building but the error is just “archiving failed”. I still can compile and launch XCode with the .xcworkspace. Launching with the . xcodeproj file will not compile lol. 3 hours yesterday to this … :slight_smile:


#6

I’m having the same issue. Did you fix it somehow? I already tried downgrading a few libraries.


#7

Just follow my steps.
I strongly recommend you to have all latests plugins, etc.
Good luck :slight_smile:


#8

I found the solution putting a setTimeOut in your platform.ready:

setTimeout(()=>{

       this.initPushNotification();
       
     }, 1000);

2 weeks founding this error…


#9

No need of timeouts. Just put your initialization inside platform.ready() in AppComponent.

        platform.ready().then(() => {

                let options: PushOptions = {
                  
                    ios: {
                        alert: 'true',
                        badge: true,
                        sound: 'true'
                    },
                    windows: {},
                    browser: {
                        pushServiceURL: 'http://push.api.phonegap.com/v1/push'
                    }
                };

                let pushObject: PushObject = this.push.init(options);
});

#10

your version of phonegap-plugin-push Plugin doesn’t support in your cordova-android version. cordova-android: 7.0.0,
try version requirement: >= cordova-android 7.1.0


#11

i have same issue?
\ Ionic Native: tried calling Push.hasPermission, but the Push plugin is not installed.
Install the Push plugin: ‘ionic cordova plugin add phonegap-plugin-push’
Ionic Native: tried calling PushNotification.init, but the PushNotification plugin is not installed.