-
Notifications
You must be signed in to change notification settings - Fork 1.9k
push.on('registration') event not called on IOS. #752
Comments
I have the same setup and the same issue on an iPhone 5s with iOs 9.3 |
@sethannabel and @s4lesman do you have a certificate from Apple with push enabled? The ID of that certificate should match the ID of your project which is used as XCode's bundle identifier. |
I do. You can see from my ios log sample gist that the plugin actually logs the token it gets back from the Apple APN_SANDBOX. 2016-03-24 09:36:03.583 myapp[764:254130] Push Plugin register success: <d261b86f 8edd7172 e9f70063 6c91f201 de959ef8 3f444802 ad8e4ab2 bc699cd2> I can also use the APN Tester tool https://itunes.apple.com/us/app/apn-tester-free/id626590577?mt=12 to manually send a notification to my device if I copy the token that I see in the logs. It seems that the plugin is just not calling my push.on('registration') event which I need to gain access to the token programmatically. Attached screenshots from my iPhone and APN Tester Tool. Since I'm seeing the token in the logs I believe my Apple Certificates are setup correctly in Xcode and my project. |
I had the several similar problems yesterday using cutting edge Xcode, iOS, cordova, .... I've downgraded a lot of stuff after that, and now on iOS 9.2.1 and Xcode 7.2 this doesn't happen anymore. I'm still using cordova 6.1 and version 1.6.0 (1.6.1?) of the plugin. As I saw you saying iOS 9.3, so I'm here to alert about Xcode, that might be on the latest version. It seems there are some issues related to Xcode 7.3 (and maybe iOS 9.3) with cordova itself. (That's me saying that; I didn't see a lot of people saying, just my experience using it on the past two days, before the downgrade). So your issue might be not related with the plugin itself (as mine weren't). I've reported one on cordova that I'm sure is related to ios-deploy or cordova-cli, and I'm investigating the others to report on the right place. But this doesn't mean that the issue isn't really here. Just some advice about using Xcode 7.3 right now. |
@sethannabel why are you calling unregister right after init? https://gist.github.com/sethannabel/68ae83a338ad4bc1eb6e#file-gistfile1-txt-L23 |
@macdonst yes I do, and I dont do the unregister. Ive double checked xcode and the push service, I am able to register with GCM , I get the token, but then when I use it on the API end, it does not get to the phone. It does get to the Android device... |
@sethannabel I'm just saying if you try to run that example code it will invalidate the token. |
I fixed my problem by filling everything on the push object. |
Commenting out unregister in my code fixed the problem. Thanks for the help! |
Exactly what does it mean that I need to fill everything on the push object? |
@macdonst brother , can you please tell us the correct steps to setup push notifications for IOS , because it works on android so good but in ios it doesn't , thank you |
@oussaki follow Tim's excellent guide at setting up your Apple Certificates https://github.com/timkim/phonegap-day-workshop-app-submission/wiki/packaging#ios Just remember to enable push when you generate your cert. |
@macdonst Im i supposed to sign the app with a cert before trying to run it on the simulator ? |
@oussaki yes, without a cert you won't get pushes. Also, test on a real device, not the iOS simulator as you won't get pushes. |
I have the same issue We are trying push notification for IOS but Register event is not getting called My code: var push = PushNotification.init({ push.on('registration', function(data) { |
This thread has been automatically locked. |
Expected Behaviour
I've recently started developing against this plugin starting with version 1.6 and now 1.6.1. When I startup my app I expect push.on('registration') to be called on IOS and Android so I can capture the registrationId and send it to my backend server. push.on('registration') isn't called on IOS, but works fine on Android.
Actual Behaviour
On IOS I don't see push.on('registration') being called, but I do on Android.
Reproduce Scenario
Install push plugin and sample code on Cordova app and run on IOS device, startup app and look at logs to confirm, do same on Android device and
Platform and Version
IOS 9.3 on Iphone 6 and on IOS 8.3 on Iphone 5 - not working on either
Android 6.01 on Nexus 5 - working
System Info
Your system information:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.0
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.2
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.3 Build version 7D175
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
NA
Sample Code that illustrates the problem
https://gist.github.com/sethannabel/68ae83a338ad4bc1eb6e
Logs taken while reproducing problem
https://gist.github.com/sethannabel/496aa1a8d4bcd1be900b
The text was updated successfully, but these errors were encountered: