Swiftpack.co - Package - kiliankoe/pushover

📌 Pushover

Simple little wrapper for the Pushover API. Use it to send push notifications from your tools to your or your user's devices.

Example

// Create a pushover object with your API token.
let pushover = Pushover(token: "YOUR_TOKEN")

// Send a simple message directly.
pushover.send("Lorem ipsum dolor sit amet.", to: "USER_OR_GROUP_KEY")

// Use `Notification`s to use more of Pushover's features.
let notification = Notification(message: "Lorem ipsum.", to: "USER")
    .devices(["iPhone"])
    .url("https://example.com")
    .urlTitle("Dolor sit amet")
    .priority(.high)
    .sound(.intermission)

pushover.send(notification)

// Use the callback to define actions based on error or success cases.
pushover.send(notification) { result in
    // A .success result case means that there were no network, server or decoding errors.
    // The request might still have failed due to a wrong API token, exceeded limits or
    // other problems. Be sure to check the response value for more information.
}

Requirements

You're going to need an API token, you can register for one here.

Also please read the Being Friendly to our API section in the Pushover API docs.

Installation

Pushover is available via Swift Package Manager.

Package.swift:

.package(url: "https://github.com/kiliankoe/pushover", from: "<#latest#>")

Contributors

Kilian Koeltzsch, @kiliankoe

License

Pushover is available under the MIT license. See the LICENSE file for more info.

Github

link
Stars: 4
Help us keep the lights on

Dependencies

Used By

Total: 0