Closed kylebrowning closed 2 years ago
This PR removes EventLoopFutures, and adds async / await capabilities
It also updates to use the last APNSwift update which under the hood uses a ASyncHTTPClient. Ive removed the unneeded protocols, and conformance in favor of passing in the client.
APNSwift
Multiple clients are now supported as well.
Its currently dependent on https://github.com/swift-server-community/APNSwift/pull/130 - Now merged
once this is merged I will put out an alpha major release for this repo as well
The new configuration interface is,
let apnsConfig: APNSConfiguration = .init( authenticationConfig: authenticationConfig, topic: "MY_TOPIC", environment: .sandbox, eventLoopGroupProvider: .shared(app.eventLoopGroup), logger: app.logger ) app.apns.containers.use(apnsConfig, as: .default)
You can also make a custom one if you'd like
extension APNSContainers.ID { static var custom: APNSContainers.ID { return .init(string: "custom") } } .... let customConfig: APNSConfiguration = .init( authenticationConfig: authenticationConfig, topic: "MY_TOPIC_CUSTOM", environment: .production, eventLoopGroupProvider: .shared(app.eventLoopGroup), logger: app.logger ) app.apns.containers.use(customConfig, as: .custom) app.get("test-push2") { req -> HTTPStatus in req.apns.client(.custom).send(.... }
This PR removes EventLoopFutures, and adds async / await capabilities
It also updates to use the last
APNSwift
update which under the hood uses a ASyncHTTPClient. Ive removed the unneeded protocols, and conformance in favor of passing in the client.Multiple clients are now supported as well.
Its currently dependent on https://github.com/swift-server-community/APNSwift/pull/130- Now mergedonce this is merged I will put out an alpha major release for this repo as well
The new configuration interface is,
You can also make a custom one if you'd like