Currently, GIDGoogleUser provides EMM error handling support by checking with itself if EMM support is provided (i.e., self.emmSupport). This call will notably occur before self.fetcherAuthorizer = authorization in the initializer.
The problem is that the implementation of -[GIDGoogleUser emmSupport] uses self.authState to determine EMM support. self.authState unfortunately, references fetcherAuthorizer.
Therefore, since GIDGoogleUser checks for EMM support prior to fetcherAuthorizer being set, it will always return nil when being checked.
- (OIDAuthState *) authState{
return ((GTMAppAuthFetcherAuthorization *)self.fetcherAuthorizer).authState;
}
- (nullable NSString *)emmSupport {
return self.authState.lastAuthorizationResponse
.request.additionalParameters[kEMMSupportParameterName];
}
- (instancetype)initWithAuthState:(OIDAuthState *)authState
profileData:(nullable GIDProfileData *)profileData {
self = [super init];
if (self) {
_tokenRefreshHandlerQueue = [[NSMutableArray alloc] init];
_profile = profileData;
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
GTMAppAuthFetcherAuthorization *authorization = self.emmSupport ?
[[GIDAppAuthFetcherAuthorizationWithEMMSupport alloc] initWithAuthState:authState] :
[[GTMAppAuthFetcherAuthorization alloc] initWithAuthState:authState];
#elif TARGET_OS_OSX || TARGET_OS_MACCATALYST
GTMAppAuthFetcherAuthorization *authorization =
[[GTMAppAuthFetcherAuthorization alloc] initWithAuthState:authState];
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
authorization.tokenRefreshDelegate = self;
authorization.authState.stateChangeDelegate = self;
self.fetcherAuthorizer = authorization;
[self updateTokensWithAuthState:authState];
}
return self;
}
Currently, GIDGoogleUser provides EMM error handling support by checking with itself if EMM support is provided (i.e.,
self.emmSupport). This call will notably occur beforeself.fetcherAuthorizer = authorizationin the initializer.The problem is that the implementation of
-[GIDGoogleUser emmSupport]usesself.authStateto determine EMM support.self.authStateunfortunately, referencesfetcherAuthorizer.Therefore, since
GIDGoogleUserchecks for EMM support prior tofetcherAuthorizerbeing set, it will always return nil when being checked.