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

iOS: Error in PushNotification.init after app update #408

Closed
vasanthv opened this issue Dec 10, 2015 · 11 comments
Closed

iOS: Error in PushNotification.init after app update #408

vasanthv opened this issue Dec 10, 2015 · 11 comments

Comments

@vasanthv
Copy link

Hello,

I am implementing push notification and it works perfectly in the first time after app install. Once I update the app with a new version "PushNotification.init" gives some error and no error is also thrown at the "error" event.

Is it only for me?

@nicoabie
Copy link

Care to give some information regarding environment, steps and description of "some error"?

@vasanthv
Copy link
Author

Phonegap build version:3.7.0
iOS: 9.2

I am running the app in the device I couldn't see any logs. Javascript didn't run anything placed after this line.
var push = PushNotification.init({
android: { senderID: "12345679" },
ios: { alert: "true", badge: "true", sound: "true", clearBadge: "true" }
});

And this happens only after updating the app. First time after installation it works perfectly.

@nicoabie
Copy link

Use this:

try {
  var push = PushNotification.init({ android: { senderID: "12345679" },
  ios: { alert: "true", badge: "true", sound: "true", clearBadge: "true" }});
} catch(error){
  alert(error)
}

@fredgalvao
Copy link
Collaborator

Also, what do you mean by "only after updating the app"?

@vasanthv
Copy link
Author

@nicoabie I get the following error in catch.

"ReferenceError: Can't find variable: PushNotification"

@vasanthv
Copy link
Author

@fredgalvao updating the app with a new version over the old version.

@nicoabie
Copy link

@vasanthv which is the command you run to update the app?

@vasanthv
Copy link
Author

@nicoabie I just re-install the app on top of the already installed app.

@vasanthv
Copy link
Author

Putting the "PushNotification.init" inside the phonegap "deviceready" event solved the problem.

Thanks

@valix85
Copy link

valix85 commented Apr 13, 2016

i have a problem on ios,
[507:58209] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["PushNotification509927292","PushNotification","init",[{"ios":{"sound":true,"badge":true},"android":{"iconColor":"#ec7416"}}]]

i'm not able to use push notification...in android work's very well

@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