Remove automaticMode property since it is not needed any more

The developer needs to call at least `authenticateInstallation` instead.
This commit is contained in:
Andreas Linde
2013-10-10 12:32:29 +02:00
parent 7052f0cd7a
commit 498bd62cbb
3 changed files with 8 additions and 28 deletions

View File

@@ -113,8 +113,8 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
* This module automatically disables itself when running in an App Store build by default! * This module automatically disables itself when running in an App Store build by default!
* *
* @warning It is mandatory to call `authenticateInstallation` somewhen after calling * @warning It is mandatory to call `authenticateInstallation` somewhen after calling
* `[[BITHockeyManager sharedHockeyManager] startManager]` or disable `automaticMode` * `[[BITHockeyManager sharedHockeyManager] startManager]` or fully customize the identification
* and fully customize the identification and validation workflow yourself. * and validation workflow yourself.
* If your app shows a modal view on startup, make sure to call `authenticateInstallation` * If your app shows a modal view on startup, make sure to call `authenticateInstallation`
* either once your modal view is fully presented (e.g. its `viewDidLoad:` method is processed) * either once your modal view is fully presented (e.g. its `viewDidLoad:` method is processed)
* or once your modal view is dismissed. * or once your modal view is dismissed.
@@ -138,23 +138,6 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
*/ */
@property (nonatomic, assign) BITAuthenticatorIdentificationType identificationType; @property (nonatomic, assign) BITAuthenticatorIdentificationType identificationType;
/**
Defines if the BITAuthenticator automatically identifies the user and also
checks if he's still allowed to use the app (depending on `restrictApplicationUsage`)
If this is set to NO, it's your responsiblity to call
- (void) identifyWithCompletion:(void(^)(BOOL identified, NSError *error)) completion;
and
- (void) validateWithCompletion:(void(^)(BOOL identified, NSError *error)) completion;
at approciate times and also block the application or re-identify the user if validation failed.
_Default_: `YES`
*/
@property (nonatomic, assign) BOOL automaticMode;
/** /**
* Enables or disables checking if the user is allowed to run this app * Enables or disables checking if the user is allowed to run this app
@@ -309,7 +292,6 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
* @warning You need to call this method in your code even if automatic mode is enabled! * @warning You need to call this method in your code even if automatic mode is enabled!
* *
* @see identificationType * @see identificationType
* @see automaticMode
*/ */
- (void) authenticateInstallation; - (void) authenticateInstallation;
@@ -324,7 +306,8 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
* once needed. * once needed.
* *
* @see identificationType * @see identificationType
* @see automaticMode * @see authenticateInstallation
* @see validateWithCompletion:
* *
* @param completion Block being executed once identification completed * @param completion Block being executed once identification completed
*/ */
@@ -349,7 +332,8 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
* once needed. * once needed.
* *
* @see identificationType * @see identificationType
* @see automaticMode * @see authenticateInstallation
* @see identifyWithCompletion:
* *
* @param completion Block being executed once validation completed * @param completion Block being executed once validation completed
*/ */

View File

@@ -64,7 +64,6 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut
_webpageURL = [NSURL URLWithString:@"https://rink.hockeyapp.net/"]; _webpageURL = [NSURL URLWithString:@"https://rink.hockeyapp.net/"];
_identificationType = BITAuthenticatorIdentificationTypeAnonymous; _identificationType = BITAuthenticatorIdentificationTypeAnonymous;
_automaticMode = YES;
_isSetup = NO; _isSetup = NO;
_restrictApplicationUsage = NO; _restrictApplicationUsage = NO;
_restrictionEnforcementFrequency = BITAuthenticatorAppRestrictionEnforcementOnFirstLaunch; _restrictionEnforcementFrequency = BITAuthenticatorAppRestrictionEnforcementOnFirstLaunch;
@@ -108,9 +107,6 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut
} }
- (void) authenticate { - (void) authenticate {
//when running in manual mode, we don't actually do anything ourselves
if(!self.automaticMode) return;
[self identifyWithCompletion:^(BOOL identified, NSError *error) { [self identifyWithCompletion:^(BOOL identified, NSError *error) {
if(identified) { if(identified) {
if([self needsValidation]) { if([self needsValidation]) {

View File

@@ -28,11 +28,11 @@ Previous versions of HockeySDK for iOS used the response of the method `UIDevice
The `BITAuthenticator` class doesn't do anything on its own. In addition to setting up the behavior, you also need to trigger the process yourself. The `BITAuthenticator` class doesn't do anything on its own. In addition to setting up the behavior, you also need to trigger the process yourself.
If `automaticMode` is enabled (default), you simply need to place a call to `[[BITHockeyManager sharedHockeyManager] authenticateInstallation]` in your code. This will show a UI asking for identification details according to the chosen strategy. The most simple option is to place a call to `[[BITHockeyManager sharedHockeyManager] authenticateInstallation]` in your code. This will show a UI asking for identification details according to the chosen strategy.
**IMPORTANT**: If your app shows a modal view on startup, make sure to call `authenticateInstallation` either once your modal view is fully presented (e.g. its `viewDidLoad:` method is processed) or once your modal view is dismissed. **IMPORTANT**: If your app shows a modal view on startup, make sure to call `authenticateInstallation` either once your modal view is fully presented (e.g. its `viewDidLoad:` method is processed) or once your modal view is dismissed.
If `automaticMode` is disabled, you need to implement your own workflow by using The second option is to implement your own workflow by using
- (void) identifyWithCompletion:(void(^)(BOOL identified, NSError *error)) completion; - (void) identifyWithCompletion:(void(^)(BOOL identified, NSError *error)) completion;