Swiftpack.co - Package - vapor-community/onesignal

OneSignal

Using OneSignal on Vapor.

For sending to an array of device tokens:

let apiKey = "YourApiKey"
let appId = "YourAppId"

let deviceTokens = ["foo...", "bar..."]
let message = OneSignalMessage("Hello Vapor!")
let notif = OneSignalNotification(message: message, users: deviceTokens)
let app = OneSignalApp(apiKey: apiKey, appId: appId)

let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next()
let resultFuture = try OneSignal(on: eventLoop).send(notification: notif, toApp: app)

Github

link
Stars: 12

Used By

Total: 0

Releases

Segments Support - 2019-09-23 00:56:39

Adds support for segments

Async HTTP Support - 2019-09-12 17:47:00

Custom Data - 2019-01-19 19:42:44

Added support for custom data in notifications Added support for delayed notifications Added support for attachments

Fixed an issue with the category not working Fixed an issue where the sound was not specified correctly

Added some basic documentation and explanations to each variable

iOS Device Token Support - 2018-10-19 05:38:19

Notification Sending Works - 2018-10-01 05:56:46

Swift 4.2 Support - 2018-09-08 22:52:52

Other public initializer fixes - 2018-09-06 17:56:32

Typo Fixes and Renames - 2018-09-06 17:49:31

1.0.0 Alpha Release - 2018-09-06 17:34:15