Releases: vapor/apns
Releases · vapor/apns
Fix APNSwiftConnection.isClosed
APNSwiftConnection.isClosed
now correctly returns false
if the channel is still active. Fixes #11.
Make Application.APNS an APNSwiftClient
In addition to req.apns
, app.apns
can now be used to send push notifications.
APNS 1.0.0 Beta 2.2
APNS 1.0.0 Beta 2.1
This package provides an easy to use API for sending push notifications to Apple's APNS powered by APNSwift.
Use app.apns
to configure your application:
import APNS
try app.apns.configure(.init(
keyIdentifier: "...",
teamIdentifier: "...",
signer: .init(file: ...),
topic: "codes.vapor.example",
environment: .sandbox
))
Then use the req.apns
to send pushes from a route handler:
app.get("send-push") { req -> EventLoopFuture<HTTPStatus> in
req.apns.send(
.init(title: "Hello", subtitle: "This is a test from vapor/apns"),
to: "..."
).map { .ok }
}