java-apns icon indicating copy to clipboard operation
java-apns copied to clipboard

Push Notifications not working for iOS 13

Open SadiquaAnjum opened this issue 5 years ago • 14 comments

Push notifications are not working once we update our iphones to iOS version 13. looks like some changes are required in order to support version 13.

https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/

What changes do we have to implement along with to support version 13?

SadiquaAnjum avatar Oct 21 '19 05:10 SadiquaAnjum

You should probably migrate to pushy. It supports Apple's new HTTP/2 APNs protocol and the new iOS 13 header requirements are supported with v0.13.10.

If you can't migrate right now, you can try to use my java-apns fork. You'll have to build it yourself. I have extended the push call with a priority parameter. Set the priority to 10 in order to send alert type push notifications or to 5 for non-alerts.

petarov avatar Oct 22 '19 08:10 petarov

@petarov Does your fork work with the mdm payload on iOS 13? If yes, which priority should be set for the mdm payload, 5 or 10?

fschaefer avatar Oct 22 '19 16:10 fschaefer

@fschaefer I don't use priority for mdm notifications. So far they seem to work well without it, at least on my side. Otherwise, I would try with 5.

petarov avatar Oct 22 '19 16:10 petarov

I've some iPadOS 13 devices that do not respond to push messages from mdm atm. I thought this was related to this...

fschaefer avatar Oct 22 '19 18:10 fschaefer

Thank you soo much @petarov . Your fork code helped me a lot and i was able to see notifications on my iPhone.

SadiquaAnjum avatar Oct 24 '19 09:10 SadiquaAnjum

Great to hear that @SadiquaAnjum!

Be advised that Apple plans to discontinue the old protocol sometime in the middle of 2020. Upgrading to another lib is highly recommended.

petarov avatar Oct 24 '19 14:10 petarov

@petarov FYI: My problem wasn't related to this library in any way.

fschaefer avatar Oct 29 '19 14:10 fschaefer

@petarov Apple announced that "legacy binary protocol" will be not supported. I know HTTP/2 is a binary protocol. My question is what is "legacy" binary protocol. Like Java Socket?

Looking forward to your apply.

fifiand1 avatar Mar 05 '21 07:03 fifiand1

@fifiand1 Yes, pretty much like Java socket. This library will no longer work after the end of March 2021.

petarov avatar Mar 05 '21 16:03 petarov

Does that include your fork or only this one?

Sorry if this question is stupid. I have one legacy service that I "inherited" and it seems to use your fork (1.0.0.Beta6, this one goes to Beta3 and your goes to Beta6). Haven't actually worked with apple notifications.

Solo761 avatar Mar 10 '21 09:03 Solo761

@Solo761 This includes my fork as well.

The java-apps lib implements the legacy APNS protocol, whereas the new APNS protocol is HTTP/2 based. You need to use a different library.

Depending on your use-case, you could also implement a simple HTTP/2 POST call yourself. Apple's docs are quite helpful on that matter: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns.

petarov avatar Mar 10 '21 11:03 petarov

Some devs might have to migrate away from java-apns in near future, so maybe I may recommend Pushy here. We migrated last year without any problems. There is even a migration guide for java-apns here.

fschaefer avatar Mar 10 '21 11:03 fschaefer

OK, thanks to both!

Guess it's time to switch iOS notifications to firebase, it already uses it for android portion so it's probably less work to implement it for iOS than to switch to new library.

But I'll check fschaefer migration guide, maybe that'll be an option too. Situation with this project is kinda complicated at the moment :)

Solo761 avatar Mar 10 '21 16:03 Solo761

Hi! java-apns still works for me, push notifications are getting sent out. So I guess that Apple still supports java-apns even though they said they would revoke their support after 31th of March?

salake avatar Apr 29 '21 08:04 salake