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

Can't find variable PushNotification #328

Closed
BishoyA opened this issue Nov 12, 2015 · 6 comments
Closed

Can't find variable PushNotification #328

BishoyA opened this issue Nov 12, 2015 · 6 comments

Comments

@BishoyA
Copy link

BishoyA commented Nov 12, 2015

Hello,

I wanted to use this plugin with my phonegap application, it wasn't working, so I decided to build the exact same example provided in the examples/www but it's also not working, (I tested using the Phonegap developer app for ios https://itunes.apple.com/de/app/phonegap-developer/id843536693?mt=8)

I debug it by showing the JS errors in an alert using this:

window.onerror = function(msg, url, linenumber) { alert('Error message: '+msg+'\nURL: '+url+'\nLine Number: '+linenumber); return true; }
I get the following error:

ReferenceError: Can't find variable: PushNotification in index.js Line Number:40

Here are the steps I folllowed:

  1. create a new cordova project ´phonegap create test´
  2. phonegap platform add ios
  3. phonegap plugin add phonegap-plugin-push
  4. I copy the files inside examples/www to the project's www.
  5. added the debugging code to the index.js
  6. phonegap build
  7. phonegap serve
  8. tested it on my phonegap developper app.

am I doing it wrong?

@macdonst
Copy link
Member

@BishoyA Yes, the PhoneGap Developer App currently does not support the PushNotification plugin. That is, the native code required for the push plugin is not compiled into that app. It is on my to do list to add it to the dev app so that people can test easier.

@BishoyA
Copy link
Author

BishoyA commented Nov 13, 2015

Okay, yes thanks for your answer! I was able to test it on a mac using cordova run ios using the ios-sim.

@BishoyA
Copy link
Author

BishoyA commented Nov 13, 2015

Okay, as an update, this one also failed, I had to do a live device test anyway..

@macdonst
Copy link
Member

Correct push notifications don't work on the ios-sim.

@himanshutecstub
Copy link

himanshutecstub commented Apr 11, 2017

Same issue try to build on https://build.phonegap.com with below code

<engine name="cordova" version=">=6.4.0"/>
<engine name="ios" version="~4.3.0"/>
<plugin name="phonegap-plugin-push">
   <param name="SENDER_ID" value="ID" />
</plugin>

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 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

3 participants