Push notifications failing on iOS

45 views
Skip to first unread message

in...@raffler.co

unread,
Feb 12, 2016, 1:35:30 PM2/12/16
to CodenameOne Discussions
Hello, I am trying to implement server push for our app which has just gone live. We are using the new push notification servers at https://push.codenameone.com/push/push. However when I dump the response it just comes back as an empty string.

I have followed the instructions detailed here http://www.codenameone.com/blog/new-push-servers.html , but our push messages are still failing. Please could someone help me understand why?

Is it possible to use the native push functionality for iOS?

Cheers,
George

If you are experiencing an issue please mention the full platform your issue applies to: 
IDE: NetBeans 
Device  all iOS;

Shai Almog

unread,
Feb 13, 2016, 12:27:15 AM2/13/16
to CodenameOne Discussions, in...@raffler.co
Hi,
Notice that for production push you need to use the production push certificate and pass true to the "production" flag instead of false.

If this doesn't solve your issue can you post more details on how you are connecting to the push servers?
Did this work in the past?
Did you regenerate client certificates?


Gareth Murfin

unread,
Feb 15, 2016, 7:41:30 AM2/15/16
to CodenameOne Discussions, in...@raffler.co
This was working in development but we have not seen it work in production. We use a php script to do the push and it was all working fine, it is either a cn1 change or something that we did on the site but we cant find anything. We have not regenerated the certs, but will do if it will help. Interestingly it doesnt seem to send in development now either, so something curious is going on, push is a total nightmare.

Gareth Murfin

unread,
Feb 15, 2016, 7:58:05 AM2/15/16
to CodenameOne Discussions, in...@raffler.co
So I decided to regen the push certs, at the end of the wizard i got "failed to generate production push certificate due to an IO error: Server error 500" not sure if thats a one off or related but reporting just in case.

Gareth Murfin

unread,
Feb 15, 2016, 8:01:47 AM2/15/16
to CodenameOne Discussions, in...@raffler.co
happens consistently for me right now, i wonder if this is related to my push problems? I cant see how though, 

in...@raffler.co

unread,
Feb 15, 2016, 12:55:14 PM2/15/16
to CodenameOne Discussions, in...@raffler.co
I have tried connecting to the push servers by http POST request. I used the exact example you provided for php. 

The response I get back is [{"id"="cn1-ios-EF8895CFCAEFBF1B0583F6FC161C1B80C626E5506B9FD038240F5627C4B56BB7","status"="inactive" }.

Could you shed some light on what status inactive means. Alternatively, is there some documentation where one can learn about each error response?

Thanks,
George

in...@raffler.co

unread,
Feb 15, 2016, 2:34:13 PM2/15/16
to CodenameOne Discussions, in...@raffler.co
I have now seen that this is the response we should use to remove the device from the list. Does your device key change each time you delete and re-download the app? It seems mine keeps changing, I'm guessing that is the reason. We are now getting the following response:

{"error":"Failed to send push to APNS: com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake"}

Would this suggest an error with the p12 files? Can't think what else could be going on. Any help would be gratefully received.

in...@raffler.co

unread,
Feb 15, 2016, 3:31:59 PM2/15/16
to CodenameOne Discussions, in...@raffler.co
Ok, I am now managing to get push notifications to my own phone on the production app. However, the response is still often (say 4/5 times) coming back with a 500, with the same handshake error. Is this a cn1 problem? 

It is working so intermittently that I feel it must be. Seems weird to be able to get some to fire and others not. 

Shai Almog

unread,
Feb 15, 2016, 11:11:00 PM2/15/16
to CodenameOne Discussions, in...@raffler.co
The 500 error in push happen if the P12 file is broken. Since you are trying to regenerate the file I'm assuming you broke it at some point and now have an invalid P12 file that you are using for some of the push calls.

The 500 error on the wizard looks related to your permissions on the apple console.

Yes, we can't remove devices from your DB and can't tell an app was uninstalled. However, when you send a push you get a response to remove the device that is no longer installed.

shannah

unread,
Feb 16, 2016, 12:40:48 PM2/16/16
to CodenameOne Discussions, in...@raffler.co
This is the error message that I pulled from the log that I think is your error.

You are not allowed to perform this operation.  Please check with one of your Team Admins, or, if you need further assistance, please contact Apple Developer Program Support.
https://developer.apple.com/support

Steve 

in...@raffler.co

unread,
Feb 16, 2016, 12:48:55 PM2/16/16
to CodenameOne Discussions, in...@raffler.co
Thank you guys, all sorted.

All the best,
George
Reply all
Reply to author
Forward
0 new messages