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
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?
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 ā¦
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
.
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 GitHub - CocoaPods/Specs: The CocoaPods Master Repo ~/.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 ā¦
Iām having the same issue. Did you fix it somehow? I already tried downgrading a few libraries.
Just follow my steps.
I strongly recommend you to have all latests plugins, etc.
Good luck
I found the solution putting a setTimeOut in your platform.ready:
setTimeout(()=>{
this.initPushNotification();
}, 1000);
2 weeks founding this errorā¦
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);
});
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
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.
The plugin needs Platform to be ready so you must first call this.platform.ready()
:
this.platform.ready().then(() => {
this.push.init(options);
// etc...
});