alexeyxo / swift-apns Goto Github PK
View Code? Open in Web Editor NEWSwift Framework for sending Apple Push Notification over HTTP/2 API
License: Apache License 2.0
Swift Framework for sending Apple Push Notification over HTTP/2 API
License: Apache License 2.0
Incorporating this in a new Swift 4 project generates several errors because of changes to Protocol Buffers
Hello!
I'm trying to use your example code for my application. I'm getting the device token correctly from the app, but no matter what I do I always get the BadDeviceToken error.
Do you know why would that happen? The app I'm trying to send it to is in Enterprise distribution, and I'm using the certificate downloaded from apple member center for distribution.
Could you also explain to me what should go as the "topic"? Bundle id of the sending app or the receiving app?
Any help and ideas would be greatly appreciated!
Thank you!
I only succeeded to get statusCode 403, translated from your library in "Bad Certificate" (not exactly the same meaning of the HTTP status code 403). My certificate is 100% genuine p12 certificate, working, for example, with NWPusher (another iOS library you can find on GitHub) and from other server endpoints. I would have liked to use your library because NWPusher is still written in legacy Obj-C code...but unfortunately I couldn't manage to make it work... have you any hint ? Have you tried to send a push notification to another iOS device ?... sorry for the stupid question but your examples do not work even with a basic test application in Xcode 8.0 (by just copying and pasting your code it didn't work for me).
/home/ubuntu/X/Server/Packages/APNS-1.2.2/Source/APNSNetwork.swift:10:8: error: no such module 'Security' import Security
Seems to fail on Linux sadly :(
Will APNS Token based authentication be implemented in this framework?
1921: extension Apple.Apns.ProviderData: GeneratedMessageProtocol - Error: Type 'Apple.Apns.ProviderData' does not conform to protocol 'GeneratedMessageProtocol' (Error is repeated 3 more times in the same file).
Using latest versions of ProtocolBuffers and APNS:
pod 'ProtocolBuffers-Swift'
pod 'APNS', '~> 1.0'
Hello! Wanna use it in backend, Perfect server on swift f.ex. Than I have plans to set up it on linux, so need I a pem format of leave it p12?
The error happens in the completion handler of the task:
in APNSNetwork.swift -> sendPush
let task = self.session?.dataTaskWithRequest(request, completionHandler: { (data, response, err) -> Void in
let (statusCode, status) = APNServiceStatus.checkStatusCode((response as! NSHTTPURLResponse))
I got an error (err = Error Domain=NSURLErrorDomain Code=-1001 "The request timed out.") and response is nil
Force unwrap of response causes a fatal error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.