I'm developing a web-app and I want to send push notifications to users on iPhone. Is there any way of doing this from the browser? Chrome or Safari does not matter.
Chrome, Firefox, Opera and Safari currently support web push notifications. Supported browsers vary by vendor. Notifications vary in appearance between browsers and operating systems. Some notifications use native notification centers, others don't.
Click on the Safari option and tap on Preferences. Tap on the Website icon, scroll down and click Notifications. Choose the site(s) you wish to receive push notifications and click Allow from the drop-down menu.
Go back to the iOS project you created earlier and select the main target. Under the Signing & Capabilities tab, click on the + Capability button, then select Push Notifications. This will enable your app to receive push notifications from OneSignal. Next, you'll need to add a Notification Extension to the app.
As of today a web app cannot receive push notifications on any iOS browser (Safari, Chrome for iOS, ...). The reason is that iOS does not yet include an implementation of Service Workers, which are needed for push notifications to work. It is currently in development, though: https://webkit.org/status/#specification-service-workers
And it is already working on Safari for OS X: https://developer.apple.com/notifications/safari-push-notifications/
Meanwhile, you will have to settle for a native implementation of your app, at least on iOS. My recommendation would be using what you have developed for web and making it a hybrid app through the use of Apache Cordova.
You can also regularly check if support is available here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With