Safari requires a different setup for push notifications compared to other browsers. This is because Apple uses its own notification service (APNs) instead of the standard web push protocol. To enable push notifications for Safari, you need to generate and upload a certificate from Apple, along with specific site details.
Obtain a Website Push ID. Go to Apple Developer and sign in. Navigate to Certificates, Identifiers & Profiles > Identifiers > Website Push IDs. Create a new Website Push ID (format: web.com.yourdomain.push).
Generate a .p12 Certificate. In the Certificates section, create a new Website Push Certificate using your Website Push ID.
Download the certificate and convert it to .p12 format using Keychain Access on a Mac.
Enter the Required Information in the Platform:
- Website Name: Enter the name of your website.
- Allowed Sub-domains: Define which subdomains can send notifications.
- Default Icon: Upload an icon that will be displayed in notifications.
Upload the .p12 Certificate. In the push notification settings of your platform, upload the .p12 file you generated earlier.
Save and Activate. Save the settings and test the push notifications to ensure Safari users receive them.
Now, Safari users can receive push notifications just like other browsers!