Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mohneesh_b_
Beginner
204 Views

Not registering ios device, Showing error "ReferenceError: Can't find variable: PushNotification" while debugging

Developing cross platform app for android and ios.

Cordova cli version : 5.1.1

Push Plugin Version : 1.4.3

IOS Device: Iphone OS v 9.3 

I am using plugin push from featured plugin for push notification. 

Not getting token, when app launch, Showing error "ReferenceError: Can't find variable: PushNotification" while debugging on ios device. It is working on android very well.

Please guide me where am I doing wrong. If any process for ios implementation is available for this plugin Please share with example.

Thanks

Tags (2)
0 Kudos
2 Replies
Pamela_H_Intel
Moderator
204 Views

Moneesh,

There have been a lot of updates to PhoneGap Push Notifications plugin since 1.4.3 related to iOS. We cannot feature the latest version because it includes a gradle script. However, I think you need a more recent version. Try the following:

  • Remove push 1.4.3 from your project using the Plugin Manager
  • Download the zip of the push plugin 1.6.4: https://github.com/phonegap/phonegap-plugin-push/archive/1.6.4.zip
  • in the plugin.xml file, comment out this line: <framework src="push.gradle" custom="true" type="gradleReference" />
  • then import the plugin as a local plugin

This should work better with iOS9.

After doing this and testing iOS, test Android again.

NOTE: If Android no longer works it is likely because the gradle script points to a specific Android version v4:23.4.0. We think that is a minimum which will be okay, and you're good. But if not, you can post back here so we can remember what happened and what the probable cause is.

mohneesh_b_
Beginner
204 Views

Dear Pamela,

Thanks for your time on this issue. 

I followed your given instructions but getting same error now.

Please let me know if I am doing anything wrong.

 

Thanks

 

Reply