google / google/GoogleSignIn-iOS

[GIDSignIn signInWithConfiguration:..] too draconian with NS_EXTENSION_UNAVAILABLE

Aperta
#90 1 commento 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Objective-C
Stelle
750
Fork
282
Merge medio
2g 15h
PR unite (30g)
9

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.