@@ -111,9 +111,9 @@ - (BOOL)handleOpenURLs:(NSArray<NSURL *> *)urls {
111
111
112
112
- (void )initializeSignInWithParameters : (nonnull FSIInitParams *)params
113
113
error : (FlutterError *_Nullable __autoreleasing *_Nonnull)error {
114
- GIDConfiguration *configuration = [self configurationWithClientIdArgument : params.clientId
115
- serverClientIdArgument : params.serverClientId
116
- hostedDomainArgument : params.hostedDomain];
114
+ GIDConfiguration *configuration = [self configurationWithClientIdentifier : params.clientId
115
+ serverClientIdentifier : params.serverClientId
116
+ hostedDomain : params.hostedDomain];
117
117
self.requestedScopes = [NSSet setWithArray: params.scopes];
118
118
if (configuration != nil ) {
119
119
self.configuration = configuration;
@@ -141,9 +141,9 @@ - (void)signInWithCompletion:(nonnull void (^)(FSIUserData *_Nullable,
141
141
// If neither are available, do not set the configuration - GIDSignIn will automatically use
142
142
// settings from the Info.plist (which is the recommended method).
143
143
if (!self.configuration && self.googleServiceProperties ) {
144
- self.configuration = [self configurationWithClientIdArgument :nil
145
- serverClientIdArgument :nil
146
- hostedDomainArgument :nil ];
144
+ self.configuration = [self configurationWithClientIdentifier :nil
145
+ serverClientIdentifier :nil
146
+ hostedDomain :nil ];
147
147
}
148
148
if (self.configuration ) {
149
149
self.signIn .configuration = self.configuration ;
@@ -270,30 +270,19 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
270
270
#endif
271
271
}
272
272
273
- // / @return @c nil if GoogleService-Info.plist not found and clientId is not provided.
274
- - (GIDConfiguration *)configurationWithClientIdArgument : (id )clientIDArg
275
- serverClientIdArgument : (id )serverClientIDArg
276
- hostedDomainArgument : (id )hostedDomainArg {
277
- NSString *clientID;
278
- BOOL hasDynamicClientId = [clientIDArg isKindOfClass: [NSString class ]];
279
- if (hasDynamicClientId) {
280
- clientID = clientIDArg;
281
- } else if (self.googleServiceProperties ) {
282
- clientID = self.googleServiceProperties [kClientIdKey ];
283
- } else {
284
- // We couldn't resolve a clientId, without which we cannot create a GIDConfiguration.
273
+ // / @return @c nil if GoogleService-Info.plist not found and runtimeClientIdentifier is not
274
+ // / provided.
275
+ - (GIDConfiguration *)configurationWithClientIdentifier : (NSString *)runtimeClientIdentifier
276
+ serverClientIdentifier : (NSString *)runtimeServerClientIdentifier
277
+ hostedDomain : (NSString *)hostedDomain {
278
+ NSString *clientID = runtimeClientIdentifier ?: self.googleServiceProperties [kClientIdKey ];
279
+ if (!clientID) {
280
+ // Creating a GIDConfiguration requires a client identifier.
285
281
return nil ;
286
282
}
283
+ NSString *serverClientID =
284
+ runtimeServerClientIdentifier ?: self.googleServiceProperties [kServerClientIdKey ];
287
285
288
- BOOL hasDynamicServerClientId = [serverClientIDArg isKindOfClass: [NSString class ]];
289
- NSString *serverClientID = hasDynamicServerClientId
290
- ? serverClientIDArg
291
- : self.googleServiceProperties [kServerClientIdKey ];
292
-
293
- NSString *hostedDomain = nil ;
294
- if (hostedDomainArg != [NSNull null ]) {
295
- hostedDomain = hostedDomainArg;
296
- }
297
286
return [[GIDConfiguration alloc ] initWithClientID: clientID
298
287
serverClientID: serverClientID
299
288
hostedDomain: hostedDomain
0 commit comments