https://github.com/vapor-community/onesignal
https://github.com/vapor-community/onesignal
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vapor-community/onesignal
- Owner: vapor-community
- Created: 2018-09-05T23:48:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-22T21:04:05.000Z (over 5 years ago)
- Last Synced: 2025-04-29T09:57:29.032Z (5 months ago)
- Language: Swift
- Size: 68.4 KB
- Stars: 13
- Watchers: 4
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OneSignal
Using OneSignal on Vapor.
For sending to an array of device tokens:
```swift
let deviceTokens = ["foo...", "bar..."]
let message = OneSignalMessage("Hello Vapor!")
let notif = OneSignalNotification(message: message, iosDeviceTokens: [deviceTokens])
let app = OneSignalApp(apiKey: Environment.get("ONESIGNAL_API_KEY") ?? "", appId: Environment.get("ONESIGNAL_APP_ID") ?? "")
let result = try OneSignal.makeService(for: request).send(notification: notif, toApp: app)
```