swift-server-community / APNSwift

📱HTTP/2 Apple Push Notification Service built with swift - send push notifications to iOS, iPadOS, tvOS, macOS, watchOS, visionOS, and Safari!
Apache License 2.0
686 stars 103 forks source link

[BUG] Package resolution never ends if used together with Vapor default template. #59

Closed Buratti closed 4 years ago

Buratti commented 4 years ago

Describe the bug Package resolution never ends if used together with Vapor default template.

To Reproduce Steps to reproduce the behavior:

  1. vapor new project
  2. Add .package(url: "https://github.com/kylebrowning/APNSwift.git", .upToNextMinor(from: "1.3.0")) to the dependencies.
  3. swift package resolve
  4. The resolution stops at Fetching https://github.com/apple/swift-nio-http2.git

Platform: Tested both on macOS 10.15.1 and Ubuntu 18.04

Swift Version: macOS: Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) Target: x86_64-apple-darwin19.0.0 Ubuntu: Swift version 5.1 (swift-5.1.2-RELEASE) Target: x86_64-unknown-linux-gnu

Vapor toolbox version: 3.1.10

Running swift build will output the following error:

error: the package dependency graph could not be resolved; possibly because of these requirements: ###

where ### can be both APNSwift or Vapor depending on the order in which you put them in your dependencies.

kylebrowning commented 4 years ago

APNSwift is not compatible with Vapor 3 because Vapor 3 is nio 1, and APNSwift is Nio 2

kylebrowning commented 4 years ago

You can use Vapor 4 though :)

Buratti commented 4 years ago

Oh, I see. Thanks :)

kylebrowning commented 4 years ago

Sorry for the confusion. There is a commit that works with Nio 1 but I would not recommend it.

What I would do, if you’re using vapor 3, is spin up a vapor 4 micro service that accepts POST and then use vapor 3 to make PPST requests to it. :)