-
Notifications
You must be signed in to change notification settings - Fork 280
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
Cannot be used in a Today App Extension #133
Comments
Due to policy, some apps may need to authorize in Browser (even though the Safari view controller is equivalent), plus the macOS version has the same method. This separation has been improved on the Maybe a compiler check can comment that out if built for extensions, do you know? |
As far as I know, the only way is to use a custom flag such as It's not an ideal solution because it really all or nothing, since If you decide to make p2.OAuth App Extension compliant (i.e. by removing these forbidden calls), you can check |
I'm having another issue: I am not able to use a shared keychain. I think p2.OAuth2 is not handling custom You could add a |
Makes sense, you mean in addition to |
Yes, as an additional setting. |
The compiler is complaining about
UIApplication.sharedApplication().openURL()
inopenAuthorizeURLInBrowser
(OAuth2+iOS.swift
).I don't think it's such a good idea to call
UIApplication.sharedApplication()
inside a framework that should not be about UI.If you really need this
openAuthorizeURLInBrowser
, you might have to create a separate extension to this framework (another pod). This pod would only be imported by targets usingUIApplication
.From my point of view, the
openAuthorizeURLInBrowser()
can be removed and only supportSFSafariViewController
by default for authorizations requiring a web page.I guess this would require the pod to be available for iOS 9 and later.
In the meantime, you could also wrap the code to make it compilable, using a
P2_APP_EXTENSIONS
macro.Apps using the framework inside a Today Extension would have to define this
P2_APP_EXTENSION
inOTHER_SWIFT_FLAGS
. This can also be automated through apost_install
script for those using Cocoapods.The text was updated successfully, but these errors were encountered: