-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift Package Manager support? #43
Comments
@powerje Yes, that is on our roadmap for our SDK and will keep you posted on our progress! |
Thank you for looking into this so quickly! When I try to pull this in via the feat/spm branch in Xcode I get an error due to the Package.swift file not being in the root of the project. I'm not sure if it is possible to direct Xcode to a subfolder to find Package.swift? I cloned the repo and used the method of dragging the src folder (the folder containing the Package.swift file) into my project. Once I added the dependency to a target that target no longer builds, interestingly Xcode shows no error output, it just fails 😅. Building my target from the command line does produce a potentially useful error:
I think that running
I added the Foundation import to SBTokenProvider which seemed to fix that issue but there are a few more:
I can look into this more next week but I'm really not sure about the UIKit import issue |
@powerje yes, that has been an issue here as well, and hoping there was an easy answer for that. I did add UIKit explicitly as a framework to see if that helped. Also made the change to the header file |
Okay, I have it building now - I'm not sure why the UIKit import was failing, but building with xcodebuild seems to work if I change the imports to point to Because the Package.swift is not at the project root I had to pull the For reference, this is the demo project & branch I pulled WAM into: and this is the PR with my changes to |
Hey @powerje, this is unrelated to the SPM discussions, but we are working on an updated SDK with a much simpler interface: If you are just getting started with integrating Notification Hubs in your app, we'd love if you could take a look at the new SDK and provide any feedback you might have. Thanks! |
@brannon thanks for sharing! We will be working on adding notification support to this project soon and I will be sure to give you feedback when we start. I'd really like to be able to use SPM to use this SDK to avoid manually importing or introducing another package manager to the project. With that in mind I have updated #47 and rebased against Does that look like an acceptable solution to getting SPM working with this project? |
@brannon I've started incorporating the SDK into my application. The API surface is a lot simpler now! One thing I noticed that I'd like to see changed is: I think a more idiomatic name would be something like: With a name like that I don't expect it to return a value. This function looks a little off in Swift code: I think it would be nice to use the NS_SWIFT_NAME_MACRO to make this a little more natural on the Swift side:
Which makes the Swift code read more naturally:
As a side note, I've updated #47 against the latest |
A few other things that I'm thinking might be useful: Add optional methods to |
@powerje If you're willing to help out with the following, we'd gratefully accept it:
|
@powerje ok, will update the API, as you're right, the whole |
@powerje Is there a reason we hard copied our files into the |
@mpodwysocki that's a good point, symlinks might be preferred. A reason to do this (which I did not do here) would be to hide some implementation details from consumers in the public headers. For example, We could, I think, modify the header in the include folder to not conform to That said, I didn't take advantage of that here so symlink would probably be preferable. |
Once you finish up with the current PR and we revisit versioning, let's try to see if we can get symlinks to work. Also, if you have other rename suggestions, I'm all ears such as
|
@powerje closing as we now have includes symlinked. If this doesn't work, let's reopen and revisit. |
Is there a roadmap or discussion around SPM support for this library? This is something I'd be happy to contribute to if the team is open to it.
The text was updated successfully, but these errors were encountered: