Closed carlhung closed 7 years ago
@carlhung which version of swift are you running? Is your project already using Kitura? If so which version?
I managed to clone and swift build
and it worked fine as stand-alone:
~/D/Tori-APNS master swiftenv local 3.0.2
~/D/Tori-APNS master ● swift build
Cloning https://github.com/IBM-Swift/Kitura.git
HEAD is now at 43d9c17 IBM-Swift/Kitura#788 Avoid converting JSON serialized Data to String and back to Data again. (#807)
Resolved version: 1.0.1
Cloning https://github.com/IBM-Swift/Kitura-net.git
HEAD is now at b61145f Merge pull request #126 from IBM-Swift/issue_784
Resolved version: 1.0.2
Cloning https://github.com/IBM-Swift/LoggerAPI.git
HEAD is now at d4c1682 Regenerated API Documentation (#15)
Resolved version: 1.0.0
Cloning https://github.com/IBM-Swift/BlueSocket.git
HEAD is now at b7a0807 Update to the latest (11/11) toolchain.
Resolved version: 0.11.40
Cloning https://github.com/IBM-Swift/CCurl.git
HEAD is now at 3cfb752 Add header callback helper function (#9)
Resolved version: 0.2.3
Cloning https://github.com/IBM-Swift/CHTTPParser.git
HEAD is now at 429eff6 Merge pull request #7 from ianpartridge/master
Resolved version: 0.3.0
Cloning https://github.com/IBM-Swift/BlueSSLService.git
HEAD is now at 68bdc2d On Linux, set the SSL context control mode to automatically retry read/write operations when necessary due to sockets being busy. Fixes issue #852 for Kitura.
Resolved version: 0.11.56
Cloning https://github.com/IBM-Swift/SwiftyJSON.git
HEAD is now at d8de7c8 Merge pull request #23 from IBM-Swift/issue_788
Resolved version: 14.2.1
Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
HEAD is now at f013da3 Regenerated API Documentation (#8)
Resolved version: 1.0.0
Compile CHTTPParser utils.c
Compile CHTTPParser http_parser.c
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Linking CHTTPParser
/Users/matteocrippa/Downloads/Tori-APNS/Packages/SwiftyJSON-14.2.1/Source/SwiftyJSON.swift:1138:27: warning: expression implicitly coerced from 'String?' to Any
self.object = newValue?.absoluteString
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/matteocrippa/Downloads/Tori-APNS/Packages/SwiftyJSON-14.2.1/Source/SwiftyJSON.swift:1138:37: note: provide a default value to avoid this warning
self.object = newValue?.absoluteString
~~~~~~~~~~^~~~~~~~~~~~~~
?? <#default value#>
/Users/matteocrippa/Downloads/Tori-APNS/Packages/SwiftyJSON-14.2.1/Source/SwiftyJSON.swift:1138:37: note: force-unwrap the value to avoid this warning
self.object = newValue?.absoluteString
~~~~~~~~~~^~~~~~~~~~~~~~
!
/Users/matteocrippa/Downloads/Tori-APNS/Packages/SwiftyJSON-14.2.1/Source/SwiftyJSON.swift:1138:37: note: explicitly cast to Any with 'as Any' to silence this warning
self.object = newValue?.absoluteString
~~~~~~~~~~^~~~~~~~~~~~~~
as Any
Compile Swift Module 'SSLService' (1 sources)
Compile Swift Module 'KituraNet' (28 sources)
Compile Swift Module 'Kitura' (40 sources)
Compile Swift Module 'ToriAPNS' (1 sources)
xcode 8.2.1, swift 3, kitura major version 1 i just copied the source file into my folder to use. it seems like work to me.
may i ask you a question that i read apple's document and some websites that apple suggests : "Keep your connections with APNs open across multiple notifications; do not repeatedly open and close connections. APNs treats rapid connection and disconnection as a denial-of-service attack."
is it possible to send multiple notifications using this library? sorry that i am new in programming.
As far as I remember this use the new http protocol, but dunno if it still need keep an open connection too.
Btw I'm pretty sure it is able to send multiple push, you have to loop the push.send
fund, I have not yet added a way to send an array of objects
thanks.
when i was cloning, i got this error. Cloning https://github.com/boostcode/tori-APNS.git HEAD is now at 556edde Update README.md Resolved version: 0.2.0 error: The dependency graph could not be satisfied (https://github.com/IBM-Swift/Kitura.git)