google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
506 stars 201 forks source link

Add `-[GIDSignIn addScopes:completion:]`to provide add scopes flow without a presenting view controller or window #285

Open mdmathias opened 1 year ago

mdmathias commented 1 year ago

The main goal of this method will be to create an instance of GIDSignInInternalOptions with no presenting window or view controller. Something like:

  GIDSignInInternalOptions *options =
      [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
                           presentingViewController:nil
#elif TARGET_OS_OSX
                                      presentingWindow:nil
#endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
                                                      loginHint:self.currentUser.profile.email
                                          addScopesFlow:YES
                                                  completion:completion];