allow customization of UDID provider webpageURL

and don't mix up SDK and webpage endpoints, but use
the right one for each job
This commit is contained in:
Stephan Diederich 2013-09-07 22:20:34 +02:00
parent 1504b2d9d9
commit c72fa30108
2 changed files with 9 additions and 3 deletions

View File

@ -88,7 +88,13 @@ typedef void(^tValidationCompletion)(BOOL validated, NSError *error);
*/
@property (nonatomic, readonly) NSString *installationIdentification;
#pragma mark - HandleURL Helper
#pragma mark - UDID auth
/**
* baseURL of the webpage the user is redirected to if authenticationType is BITAuthenticatorAuthTypeWebbased
* defaults to https://rink.hockeyapp.net but can be overwritten if desired
*/
@property (nonatomic, strong) NSURL *webpageURL;
/**
* should be used by the app-delegate to forward handle application:openURL:sourceApplication:annotation calls

View File

@ -30,7 +30,7 @@ static NSString* const kBITAuthenticatorLastAuthenticatedVersionKey = @"BITAuthe
- (instancetype) initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment {
self = [super initWithAppIdentifier:appIdentifier isAppStoreEnvironemt:isAppStoreEnvironment];
if( self ) {
_webpageURL = [NSURL URLWithString:@"https://rink.hockeyapp.net/"];
}
return self;
}
@ -383,7 +383,7 @@ static NSString* const kBITAuthenticatorLastAuthenticatedVersionKey = @"BITAuthe
- (void)authenticationViewControllerDidTapWebButton:(UIViewController *)viewController {
NSURL *hockeyWebbasedLoginURL = [self.hockeyAppClient.baseURL URLByAppendingPathComponent:[NSString stringWithFormat:@"apps/%@/authorize", self.encodedAppIdentifier]];
NSURL *hockeyWebbasedLoginURL = [self.webpageURL URLByAppendingPathComponent:[NSString stringWithFormat:@"apps/%@/authorize", self.encodedAppIdentifier]];
[[UIApplication sharedApplication] openURL:hockeyWebbasedLoginURL];
}