diff --git a/Sources/APNS/Application+APNS.swift b/Sources/APNS/Application+APNS.swift index 15c4bad..6edcd36 100644 --- a/Sources/APNS/Application+APNS.swift +++ b/Sources/APNS/Application+APNS.swift @@ -19,7 +19,6 @@ extension Application { } } - struct PoolKey: StorageKey, LockKey { typealias Value = EventLoopGroupConnectionPool } @@ -60,6 +59,52 @@ extension Application.APNS: APNSwiftClient { self.application.eventLoopGroup.next() } + public func batchSend( + rawBytes payload: ByteBuffer, + pushType: APNSwiftConnection.PushType, + to deviceToken: String..., + expiration: Date?, + priority: Int?, + collapseIdentifier: String?, + topic: String?, + logger: Logger?, + apnsID: UUID? = nil) + -> EventLoopFuture { + batchSend(rawBytes: payload, + pushType: pushType, + to: deviceToken, + expiration: expiration, + priority: priority, + collapseIdentifier: collapseIdentifier, + topic: topic, + logger: logger, + apnsID: apnsID) + } + + public func batchSend( + rawBytes payload: ByteBuffer, + pushType: APNSwiftConnection.PushType, + to deviceToken: [String], + expiration: Date?, + priority: Int?, + collapseIdentifier: String?, + topic: String?, + logger: Logger?, + apnsID: UUID? = nil) + -> EventLoopFuture { + deviceToken.map { + send(rawBytes: payload, + pushType: pushType, + to: $0, + expiration: expiration, + priority: priority, + collapseIdentifier: collapseIdentifier, + topic: topic, + logger: logger, + apnsID: apnsID) + }.flatten(on: self.eventLoop) + } + public func send( rawBytes payload: ByteBuffer, pushType: APNSwiftConnection.PushType,