You have only three main options to get push notifications working on iOS for a PWA. In both cases, you must register an App ID on Apple Developer portal, with permission to the appropriate service. For Option 1, your registered App ID must have permission to Apple Wallet. For options 2 and 3, you must have permission to Push Notifications. In both cases, you should record your Bundle ID and Team ID in case you need it later.
Option 1 (Easier): Use PassKit to set up a generic Apple Wallet pass, which can broker notifications that are very similar to native ones. Here's some documentation, and here's a working demo of how this can send push notifications to registered devices.
Option 2 (Harder): Use Firebase Cloud Messaging or a package like Node-APN to send push notifications the "proper" way, signed with a P12 or P8 key from the Apple Developer Portal. This gets tricky mainly because you need the iOS device identifier, which is only exposed to applications installed natively. I'm afraid I don't have an answer on how to get this device ID from within a PWA, and without it, this method doesn't work.
Option 3 (not a PWA): You can use an App ID with a provisioning profile and either a P12 or P8 key, similar to the previous option, but you wrap your application in Apache Cordova, and distribute it (either through the public app store, or using MDM software and via the private Apple Business Manager).
Those are your options. I have exhausted every possible avenue researching this, and I am confident that these will remain your only options through at least the next several months. It's possible we may see further support for Web Push or perhaps just a way to get the device ID from the web in the future, but until that time, this is it. There aren't any other ways to go about this presently.
Source: I architect and develop apps for major brands like Subway, Gartner, Morgan Stanley and PwC (among many others). My research is very recent, and includes direct communication with the head of WebKit at Apple, and also with one of the world's foremost PWA and iOS experts.
Answer from Crates on Stack OverflowYou have only three main options to get push notifications working on iOS for a PWA. In both cases, you must register an App ID on Apple Developer portal, with permission to the appropriate service. For Option 1, your registered App ID must have permission to Apple Wallet. For options 2 and 3, you must have permission to Push Notifications. In both cases, you should record your Bundle ID and Team ID in case you need it later.
Option 1 (Easier): Use PassKit to set up a generic Apple Wallet pass, which can broker notifications that are very similar to native ones. Here's some documentation, and here's a working demo of how this can send push notifications to registered devices.
Option 2 (Harder): Use Firebase Cloud Messaging or a package like Node-APN to send push notifications the "proper" way, signed with a P12 or P8 key from the Apple Developer Portal. This gets tricky mainly because you need the iOS device identifier, which is only exposed to applications installed natively. I'm afraid I don't have an answer on how to get this device ID from within a PWA, and without it, this method doesn't work.
Option 3 (not a PWA): You can use an App ID with a provisioning profile and either a P12 or P8 key, similar to the previous option, but you wrap your application in Apache Cordova, and distribute it (either through the public app store, or using MDM software and via the private Apple Business Manager).
Those are your options. I have exhausted every possible avenue researching this, and I am confident that these will remain your only options through at least the next several months. It's possible we may see further support for Web Push or perhaps just a way to get the device ID from the web in the future, but until that time, this is it. There aren't any other ways to go about this presently.
Source: I architect and develop apps for major brands like Subway, Gartner, Morgan Stanley and PwC (among many others). My research is very recent, and includes direct communication with the head of WebKit at Apple, and also with one of the world's foremost PWA and iOS experts.
I just want to let you all know: Apple will support push notifications for web apps! This news was published at the WWDC2022. Apple will release Web Push with Safari 16 on macOS (Ventura) in a few months (2022) and for iOS and iPadOS in 2023.
See: https://webkit.org/blog/12945/meet-web-push/
Videos
Hello everyone
I've been reading that it is possible to have push notifications via using Passbook (now called Wallet).
I was wondering if anyone has implemented this and has any tips or learnings about it and the structure of doing it?
Here the best post I've found explaining it: https://stackoverflow.com/questions/63819485/sending-push-notifications-to-ios-from-pwa
Trying to get push notifications to work on iOS. Been trying for a few days but couldn't get it to work.
Any thoughts? 🙏🏻🙏🏻
Have there been any advancements for PWAs on iOS 15/Safari? I’m assuming we still don’t have push notifications, but each OS update seems to bring at least something. Anyone have a comprehensive list?
I have a client requesting chat functionality in their app. I am yet to start the app, because I want to know my requirements before beginning. I primarily develop in VueJS, and this will be a mobile focused platform. With a chat feature, it makes sense to use push notifications. How should I solve this issue?
I am reluctant to build a Swift/iOS frontend alongside a PWA (for web and Play Store) since I haven't built in Swift before, and that would double my frontend's workload. On top of that, my client can't afford to give Apple their 30% cut. So it seems native for iOS is not an option. Here are the options I can imagine:
In combination with a "conditional delay," where a user has 3 minutes to open a message they've received. The idea is that if they're actively using the PWA, they'll see a notification that they got a message. Whether they're actively on the platform or not, my server will count to 3 (mins) and send them one of the following alerts if the message still hasn't been opened.
-
Mobile Wallet updates - this stackoverflow answer let me down a helpful path. I could create "MyApp Mobile Pass," and send an update to this pass when a user gets a message, after the conditional delay.
-
SMS - send a text to that user when they get a message, only if they haven't opened that message 3 minutes after it was sent to them after the conditional delay.
Have any of you built PWAs in this fashion, or have any other creative solutions to working around iOS's walled garden?
I'm open to building a hybrid app in Vue/Ionic, but even then the 30% cut Apple takes would cripple my client's business. So I either need a payment or APN work around.