Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

ERROR: Plugin 'PushNotification' not found #568

Closed
dany25 opened this issue Feb 3, 2016 · 8 comments
Closed

ERROR: Plugin 'PushNotification' not found #568

dany25 opened this issue Feb 3, 2016 · 8 comments

Comments

@dany25
Copy link

dany25 commented Feb 3, 2016

Hi guys,
I'm sorry i have to ask for help, i spent almost a day on this and i can't find where the problem is.

I added phonegap-plugin-push, built ios, wrote in my js file :

                    var push = PushNotification.init({
                        android: {
                               senderID: "XXXXXXXXX"
                           },
                           ios: {
                               alert: "true",
                               badge: "true",
                               sound: "true"
                           },
                           windows: {}
                       });


                    push.on('registration', function(data) {
                         alert(data.registrationId);
                    });

                    push.on('notification', function(data) {
                        // data.message,
                        // data.title,
                        // data.count,
                        // data.sound,
                        // data.image,
                        // data.additionalData
                    });

                    push.on('error', function(e) {
                        alert(e.message);
                    });

Problem is when i build it on xCode and test it on a REAL device, i get the following error:
ERROR: Plugin 'PushNotification' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

So: -I tried to touch to config.xml, in spite of the fact that i read on other issues that it should be automatic, i wrote what is advised at https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PHONEGAP_BUILD.md and nothing changed.
It's driving me crazy, i can't even get a registration number or a "classical" error.

I got all the registration stuff done, both for apns and gcm.
I tried multiple times to update cordova, call other .js, rebuild platforms, without success.
I might have read 90% of all the issues, and the only ones related to this problem are from the deprecated plugin (which i never used), and when i test the solutions described they don't work ..
I am waiting for the "deviceready" too.

Thanks for help.

@charpin
Copy link

charpin commented Feb 3, 2016

After you added this plugin to your iOS platform, did you see the plugin folder is inside it ?

projectName/platforms/ios/projectName/Plugins

Do you added also the following property in your config.xml file ?

<feature name="PushPlugin">
    <param name="ios-package" value="PushPlugin" />
</feature>

@dany25
Copy link
Author

dany25 commented Feb 3, 2016

I had all this ..
Problem solved, it was my environment.
I am working on two computer, updated cordova on one but not on the other.
I just updated it on the second one, and it worked : Magic.
Thanks for the quick answer @charpin !

@dany25 dany25 closed this as completed Feb 3, 2016
@slorber
Copy link
Contributor

slorber commented Jun 13, 2016

@charpin by chance do you know why it's necessary to add this feature in config.xml? I don't remember it was needed before

@macdonst
Copy link
Member

@slorber they probably weren't using a late enough version of cordova-ios and added it manually. If you are using 1.6.x use cordova-ios 4 or better, for 1.7.x use cordova-ios 4.1 or better.

@slorber
Copy link
Contributor

slorber commented Jun 13, 2016

Yes i just found the incompatibility issue somewhere else thanks :)

In the future maybe you could add a warning in the console iif you detect an io platform < 4.x ?

@macdonst
Copy link
Member

@slorber there is a warning.

Fetching plugin "phonegap-plugin-push" via npm
Installing "phonegap-plugin-push" for ios
Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.8.0, failed version requirement: >=4.1.0
Skipping 'phonegap-plugin-push' for ios
 Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to cordova-ios@4.0.0 or newer.

@slorber
Copy link
Contributor

slorber commented Jun 14, 2016

hmmm sorry missed it :)

Actually I was looking for a console warning, because my platform prepare has so many logs of other plugins that I never read the output unless there's a stack

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants