Fix for iOS 8 & previous in Xcode 6 & previous#317
Fix for iOS 8 & previous in Xcode 6 & previous#317sclement41 wants to merge 3 commits intophonegap-build:masterfrom
Conversation
|
This PR works perfectly for me (at least on iOS 7, XCode 5.1.1) |
|
I added conditional compile guards around the use of UserNotificationTypes, that fixes the compilation issue. |
|
@sclement41, thanks for this fix! |
|
Notification is not working with 2.3.1. When we rolled it back to 2.1.1 it's working. |
|
Works perfect ! iOS 7 & 8 on Xcode 6, cordova edge |
|
@sclement41 thanks for upgrading. Works perfectly on iOS 7.1.2 and XCode 5.1.1 |
|
Let's not be too harsh on the maintainer without automated test scripts its hard to test for everything! |
|
Of course you're right and it's open source. I have much respect for that. I guess I'm just a little bit angry of myself. The problem was that everything worked fine 2 weeks ago, then I started a new project and just downloaded everything with Cordova CLI and I was trying 10 hours to debug my JS-Code and could not figure out what happened ( till I used to visit this Github page... should have done this before :( ) |
|
Will it merged to phonegap build? |
|
I've made a test scenario matrix to wrap my head around the before and after of this patch. Hopefully this helps everyone else too. Please let me know if my assumptions are wrong: |
|
We use Adobe's build and reverted to 2.1.1. Looks like this has to be merged and pushed. |
|
This has fixed push notifications for us on ios7 and ios8, thank you very much for this patch. :) |
|
Thanks for this patch. Saved me huge headaches. |
|
I notice that badge counts aren't updated when the app is closed, although can't be entirely sure whether or not this is entirely related to this patch. It's possible other issues could be at play. Could anyone confirm this works for them? |
|
@jrstanley I have this problem too. But for me, the badge doesn't display at all. |
|
A version 2.4.0 of this plugin has been added to Phonegap Build, which includes this patch. Please test and get back, and I will merge it into the mainline. @oscarabilleira |
|
@wildabeast where can we grab version 2.4.0? |
|
@hirbod on Phonegap Build it can be found here: https://build.phonegap.com/plugins/1199. I haven't merged and tagged it yet because I was hoping for some help with testing (I can't currently do it). But you can find the merged dev branch here: https://github.com/phonegap-build/PushPlugin/tree/sclement41-master. |
|
@wildabeast cordova plugin add https://github.com/phonegap-build/PushPlugin#sclement41-master |
|
hi everybofy |
|
@bau720123 Did it solve badge count issue? |
|
@sharat |
|
Try this #332 |
|
I receive the badge attr in the app, but when my app is closed the badge counter does not change. Messages working fine... |
|
hi @hirbod I am using PGB 3.63 and plugin 2.40 on iOS 8.02 |
|
@bau720123 Before I used 2.1.1. When I send a push message trough my server I received a message and the badge counter on my app changed. (while app was closed) Now I do receive the message but the badge counter does not change either get set to anything.. |
|
@hirbod Let me try that. Thank you. |
|
hi @hirbod step 1,send a message from php step 2,receive a message (app not open yet before),the desktop's "badge number" will show PS PS2 |
|
Are you on iOS8 ? Cause as I told you before, I'm on iOS7 and this could be the problem. If my app is closed, the springboard badge counter will not be set. If the app is open and I call manually it works. But actually, this call should work inside of my onNotificationAPN function (as it did on PushPlugin Version 2.1.1) I'm not the only person with this problem as you can read in the beginning. This PR fixes the main issue with registering and calling the callbacks but also broke the badge counter - at least for me on iOS 7.1.2 |
|
hi @hirbod |
|
It's worth noting that the So, for instance, if you build the plugin with Xcode 5 / iOS 7, your app is not going to work for iOS 8 devices. Conversely, if you build with iOS 8, the compiled app is not going to work on < iOS 8 devices. You need a runtime check. You can take a look at the way we did it with |
|
We are facing the same issue in devices with < iOS 8 , we got the push messages but the badge number did not update. in iOS 8 , it is working fine. Version 2.1.1 was working fine with devices having iOS version < 8. I had issues with 2.3.1. I think you should refer to the version 2.1.1 code to see what have been changed to break the code. |
|
This has been merged. |
|
@wildabeast does this fix the badge count issue? |
|
@sharat no. This is a pull request, and I have merged the code contained in it. The badge count issue is separate and should be discussed in another thread such as #348. I myself cannot currently apply time to looking at a fix for this, but can merge fixes and deploy to PGB if there is a consensus on a tested fix. |
|
@wildabeast seems like your the only hope right now as nobody seems to have any idea with this bug. and did someone verify @khawkins statement? cause this plugin seem to work on iOS 7 and iOS 8 (with broken badge counter on iOS 7). I will try @khawkins fork later and will report |
|
@hirbod I'd be interested to hear how it goes. I unfortunately also do not have time to rationalize our changes back into the main repo here at the moment. I've heard from folks on our side that our repo seems to work, but I don't know how exhaustively they've tested it. |
|
Hello everybody, hi @khawkins, just installed @khawkins fork (after removing the PushPlugin) Open Xcode, Open Plugins, Mark all Files with .m / .mm (not .h) and then, on the right side, toggle "Target Membership" active (this will prevent the Cordova 3.5.0 bug "CDVPlugin not found") So.... Big thanks. It just works! Bade counter works fine and I do receive push notifications. There is just one thing that seems to be different: the object. Before I could access the message with "event.alert".. Now it is a bit different. iOS 7.1.2, Xcode 5.1.1 Now it's up to you guys. Try to compile with iOS 8 on Xcode 6. When it work, we should remove @sclement41 PR and Push @khawkins repo to the official build! Thank you very much @khawkins |
|
Does this version solve the problem with the asidentifier manager that the 2.3.1 version has?.... Apple is rejecting my app due to that |
|
Does anybody could test @khawkins's fork? https://github.com/forcedotcom/PushPlugin#unstable I added it and register sucessfuly, but the device (iOS 8) is not receiving any push. |
|
It works. The object in JavaScript is just different. You need to access it trough event.aps.payload.message etc. Just try to put event in console.log() |
|
I am using the ngCordova's $cordovaPush wrapper (http://ngcordova.com/docs/#Push) with the code: // push received!!
$scope.$on('pushNotificationReceived', function(event, notification) {
console.log('Push received!');
console.log(event, notification);
});but the block is never being executed |
|
Same here @JavierMartinz, I've been trying to make it work with that simple snippet on iOS8+ and no luck yet. |
|
I just tested it without ngCordova's wrapper and it is also not working. Did you test it with iOS 8.1 @hirbod ? |
|
HI @JavierMartinz , works perfectly on iOS 8.1 with iPhone 6+ (real device) |
|
I was using production certificates instead of development ones, my fail 👎 |
|
Fine, I'm lucky you found the problem :) 👍 |

This fixes the issue of the registration not working in plugin version 2.3.1 for iOS 7 & previous. The fix checks the SDK version at compile time, and then uses the appropriate methods at runtime.