website

command
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 13 Imported by: 0

README

Safari Push Notifications

How to use this example in development.

  1. Create a Website Push ID in Apple's Member Center. This requires a CSR from your keychain.

  2. Download the certificate from Apple's website and add it to your Keychain.

  3. Export a .p12 with the certificate and the private key you generated during step 1.

  4. Update main.go with the PushID you used in step 1.

  5. Download and install ngrok and create an account.

  6. Create a secure tunnel to port 5000 on your local machine by running ngrok http 5000.

  7. You can visit localhost:4040 in your web browser to see requests as they happen.

  8. In ngrok you will see a custom URL like https://<something>.ngrok.io. Update AllowedDomains, URLFormatString, and WebServiceURL in main.go based on your custom URL. Be sure to use HTTPS.

  9. Build and run the example with go run main.go -c /path/to/certificate.p12

  10. Visit your https://<something>.ngrok.io URL in Safari to request permission and then send a push notification, which will appear in your Notification Center.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL