https://github.com/rohenaz/go-web-push-package
Generates a push package for use with Apple's Push Notification Service
https://github.com/rohenaz/go-web-push-package
Last synced: 2 months ago
JSON representation
Generates a push package for use with Apple's Push Notification Service
- Host: GitHub
- URL: https://github.com/rohenaz/go-web-push-package
- Owner: rohenaz
- Created: 2018-03-06T15:00:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T17:08:21.000Z (about 7 years ago)
- Last Synced: 2025-01-22T10:12:45.612Z (4 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-web-push-package
[WIP] Generates a push package for use with Apple's Push Notification Service## Prerequisites
Uses openssl to sign the manifest## Installation
$ go get github.com/rohenaz/go-web-push-package
## Usage
```
Define your package config as follows:PushPackageConfig {
website {
"websiteName": "Test",
"websitePushID": "web.example.test",
"allowedDomains": ["https://example.com"],
"urlFormatString": "https://example.com/%@",
"authenticationToken": "19f8d7a6e9fb8a7f6d9330dabe",
"webServiceURL": "https://example.com",
}
iconPath: 'path/to/iconFolder'
certificates {
signer: 'certificates/cert.pem',
key: 'certificates/key.pem',
}
}
```
Generage the package and return the archive`buffer, err := PushPackageConfig.GeneratePackage()`
Write your response
```
w.Header().Set("Content-type", "application/zip")
w.Write(buffer.Bytes())
```the above would generate a package looking like this
- icon.iconset/icon_128x128.png
- icon.iconset/[email protected]
- icon.iconset/icon_16x16.png
- icon.iconset/[email protected]
- icon.iconset/icon_32x32.png
- icon.iconset/[email protected]
- manifest.json
- signature
- website.json