Skip to content
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

[GIDSignIn signInWithConfiguration:..] too draconian with NS_EXTENSION_UNAVAILABLE #90

Open
gutley opened this issue Jan 6, 2022 · 1 comment

Comments

@gutley
Copy link

gutley commented Jan 6, 2022

v6.1.0 of the SDK changed some of the methods in GIDSignIn to become unavailable to extensions. Whilst I can understand the motive, I think this is too draconian a change. In my app, I have a shared library that is used by the main app itself and various extensions. This library includes the Google sign-in support, but that side of things is only ever used by the app itself, not the extensions and the code already ensures you aren't running as an extension before attempting to sign-in. But with 6.1.0, my library no longer builds as it hits this error:

'signIn(with:presenting:callback:)' is unavailable in application extensions for iOS: The sign-in flow is not supported in App Extensions.

Whilst I 'could' refactor my library to extract out the non-extension friendly parts into another shared library, this is no small undertaking and provides no real-world benefit for the time involved.

I have a couple of solutions:

  1. Just revert the change that added NS_EXTENSION_UNAVAILABLE to the various calls.
  2. Add explicit equivalents of the NS_EXTENSION_UNAVAILABLE calls that make it clear that its OK to include them in a library, but that they MUST not be actually called from an extension.

For now, my only solution is to just limit my SDK usage to pre 6.1.0 versions.

@petea
Copy link
Contributor

petea commented Apr 7, 2022

Have you considered defining a macro for your extension target and using the preprocessor to exclude the calls to NS_EXTENSION_UNAVAILABLE methods in your library at build time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants