HTTP/2 Apple Push Notification Service (APNs) push provider written in Swift
- Sends notification using new HTTP/2 protocol
- Send notifications iOS, tvOS and macOS apps
##CocoaPods CocoaPods adds supports for Swift and embedded frameworks.
To integrate APNSwift into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'APNSwift'
let apnsConnection = APNS(identity: certificateIdentity, options: apnsOptions)
guard let apns = APNS(certificatePath: "/path/to/PKCS/certificate", passphrase: "********") else {
//Failed to create APNS object
return nil
}
var apnsOptions = APNS.Options()
apnsOptions.topic = "Weekend deal"
apnsOptions.port = .p2197
apnsOptions.expiry = NSDate()
apnsOptions.development = false
try! apnsConnection.sendPush(tokenList: tokens, payload: jsonPayLoad) {
(apnsResponse) in
Swift.print("\n\(apnsResponse.deviceToken)")
Swift.print(" Status: \(apnsResponse.serviceStatus)")
Swift.print(" APNS ID: \(apnsResponse.apnsId ?? "")")
if let errorReason = apnsResponse.errorReason {
Swift.print(" ERROR: \(errorReason)")
}
}
APNS Push is a Mac app that allows you to send notifications over a HTTP/2
connection. APNS Push app uses the APNSwift
library to send push notifications
Now seamlessly send Push Notifications to your iPhone, iPad, Mac and Safari
- Directly send notifications using Certificates in KeyChain
- Also supports newly introduced Unified Push certificates
Basic mode
for quickly testing notificationsAdvanced mode
for more fine grained control over push notifications