diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 295cbca35f..c491490db9 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -275,8 +275,8 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut - (NSDictionary*) validationParameters { NSParameterAssert(self.installationIdentifier); - NSParameterAssert(self.installationIdentifierTypeString); - return @{self.installationIdentifierTypeString : self.installationIdentifier}; + NSParameterAssert(self.installationIdentifierParameterString); + return @{self.installationIdentifierParameterString : self.installationIdentifier}; } + (BOOL) isValidationResponseValid:(id) response error:(NSError **) error { @@ -639,8 +639,14 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut return [[NSUserDefaults standardUserDefaults] objectForKey:kBITAuthenticatorLastAuthenticatedVersionKey]; } -- (NSString *)installationIdentifierTypeString { - return [self.class stringForIdentificationType:self.identificationType]; +- (NSString *)installationIdentifierParameterString { + switch(self.identificationType) { + case BITAuthenticatorIdentificationTypeHockeyAppEmail: + return @"iuid"; + case BITAuthenticatorIdentificationTypeHockeyAppUser: return @"auid"; + case BITAuthenticatorIdentificationTypeDevice: return @"udid"; + case BITAuthenticatorIdentificationTypeAnonymous: return @"uuid"; + } } + (NSString *)stringForIdentificationType:(BITAuthenticatorIdentificationType) identificationType { diff --git a/Classes/BITAuthenticator_Private.h b/Classes/BITAuthenticator_Private.h index 36f87fff52..c7d51ea726 100644 --- a/Classes/BITAuthenticator_Private.h +++ b/Classes/BITAuthenticator_Private.h @@ -50,9 +50,9 @@ @property (nonatomic, copy) NSString *lastAuthenticatedVersion; /** - * return the string used to identify this app against the HockeyApp backend. + * returns the type of the string stored in installationIdentifierParameterString */ -@property (nonatomic, copy, readonly) NSString *installationIdentifierTypeString; +@property (nonatomic, copy, readonly) NSString *installationIdentifierParameterString; /** * returns the string used to identify this app against the HockeyApp backend. diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 22283d2166..8d5acfa5a6 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -356,7 +356,7 @@ #if HOCKEYSDK_FEATURE_AUTHENTICATOR if (_authenticator) { [_updateManager setInstallationIdentification:[self.authenticator installationIdentifier]]; - [_updateManager setInstallationIdentificationType:[self.authenticator installationIdentifierTypeString]]; + [_updateManager setInstallationIdentificationType:[self.authenticator installationIdentifierParameterString]]; [_updateManager setInstallationIdentified:[self.authenticator isIdentified]]; } #endif diff --git a/Support/HockeySDKTests/BITAuthenticatorTests.m b/Support/HockeySDKTests/BITAuthenticatorTests.m index 30c3f17b25..e2ea3441b3 100644 --- a/Support/HockeySDKTests/BITAuthenticatorTests.m +++ b/Support/HockeySDKTests/BITAuthenticatorTests.m @@ -111,7 +111,7 @@ static void *kInstallationIdentification = &kInstallationIdentification; assertThatBool(_sut.isValidated, equalToBool(NO)); assertThat(_sut.authenticationSecret, equalTo(nil)); assertThat(_sut.installationIdentifier, equalTo(nil)); - assertThat(_sut.installationIdentifierTypeString, equalTo(@"uuid")); + assertThat(_sut.installationIdentifierParameterString, equalTo(@"uuid")); } #pragma mark - General identification tests