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
478 stars 194 forks source link

Fix -[GIDSignIn configureWithCompletion:] once GIDSignIn is not a singleton #322

Closed mdmathias closed 1 year ago

mdmathias commented 1 year ago

Is your feature request related to a problem you're having? Please describe. Per a comment on this PR, it was noted that we are not able to use a memberwise initializer in GIDSignIn to pass in an instance of GIDAppCheck. Therefore, we use a private initializer in tests to pass in an instance of GIDAppCheck. Thus, GIDSignIn needed a way in the configure method to check if there is already an instance of GIDAppCheck. If there is, do nothing; otherwise, make the default instance (i.e., one not for tests).

Describe the solution you'd like GIDSignIn shouldn't be a singleton. Once that is the case, we can pass in whatever we like in the initializer.

mdmathias commented 1 year ago

Closing per https://github.com/google/GoogleSignIn-iOS/pull/314/commits/74913be3d79b1a3a9f1661206b43ff9399cad136#diff-b76ad8011382daf05bf7a830db6abe2428c68fbeadd4b617b39bd2c504e2b640R463-R467