From d7ae69860d093a8a58814f7529c019fda65b8454 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Thu, 12 Sep 2013 12:21:12 +0200 Subject: [PATCH] Various documentation fixes and updates --- Classes/BITAuthenticationViewController.h | 6 + Classes/BITAuthenticator.h | 57 +++++++-- Classes/BITAuthenticator.m | 14 +-- Classes/BITAuthenticator_Private.h | 9 +- ...BITFeedbackComposeViewControllerDelegate.h | 36 ++++-- Classes/BITFeedbackManager.h | 24 +++- Classes/BITFeedbackMessage.h | 31 +++-- Classes/BITHockeyAppClient.h | 3 + Classes/BITHockeyBaseManagerPrivate.h | 19 +-- Classes/BITHockeyManager.h | 4 +- Classes/BITHockeyManagerDelegate.h | 28 +++-- Classes/BITStoreUpdateManager.h | 18 ++- Classes/BITStoreUpdateManager.m | 14 +-- Classes/BITStoreUpdateManagerDelegate.h | 2 +- Classes/BITUpdateManager.h | 16 ++- Classes/BITUpdateViewControllerPrivate.h | 22 +++- Classes/HockeySDK.h | 111 +++++++++++++++--- Support/HockeySDK.xcodeproj/project.pbxproj | 2 +- ...de-Installation-Setup-Advanced-template.md | 17 --- docs/Guide-Installation-Setup-template.md | 17 --- 20 files changed, 314 insertions(+), 136 deletions(-) diff --git a/Classes/BITAuthenticationViewController.h b/Classes/BITAuthenticationViewController.h index f3fd567a71..cb70ffb083 100644 --- a/Classes/BITAuthenticationViewController.h +++ b/Classes/BITAuthenticationViewController.h @@ -31,6 +31,9 @@ @class BITAuthenticator; @class BITHockeyAppClient; +/** + * View controller handling user interaction for `BITAuthenticator` + */ @interface BITAuthenticationViewController : UITableViewController - (instancetype) initWithDelegate:(id) delegate; @@ -61,6 +64,9 @@ @end +/** + * BITAuthenticationViewController protocol + */ @protocol BITAuthenticationViewControllerDelegate /** diff --git a/Classes/BITAuthenticator.h b/Classes/BITAuthenticator.h index 8a94cc3589..9386f7e147 100644 --- a/Classes/BITAuthenticator.h +++ b/Classes/BITAuthenticator.h @@ -30,19 +30,47 @@ #import "BITHockeyBaseManager.h" +/** + * Auth types + */ typedef NS_ENUM(NSUInteger, BITAuthenticatorAuthType) { + /** + * Ask for the HockeyApp account email + */ BITAuthenticatorAuthTypeEmail, + /** + * Ask for the HockeyApp account email and password + */ BITAuthenticatorAuthTypeEmailAndPassword, + /** + * Request the device UDID + */ BITAuthenticatorAuthTypeUDIDProvider, //TODO: add Facebook? }; //TODO: think about name. call it registration?! + +/** + * Validation types + */ typedef NS_ENUM(NSUInteger, BITAuthenticatorValidationType) { - BITAuthenticatorValidationTypeNever = 0, //never try to validate the current installation - BITAuthenticatorValidationTypeOptional, //asks the user if he wants to authenticate himself - BITAuthenticatorValidationTypeOnFirstLaunch, //checks if the user is authenticated first time a new version is run - BITAuthenticatorValidationTypeOnAppActive, //checks if the user is authenticated everytime the app becomes active + /** + * never try to validate the current installation + */ + BITAuthenticatorValidationTypeNever = 0, + /** + * asks the user if he wants to authenticate himself + */ + BITAuthenticatorValidationTypeOptional, + /** + * checks if the user is authenticated first time a new version is run + */ + BITAuthenticatorValidationTypeOnFirstLaunch, + /** + * checks if the user is authenticated everytime the app becomes active + */ + BITAuthenticatorValidationTypeOnAppActive, }; typedef void(^tAuthenticationCompletion)(NSString* authenticationToken, NSError *error); @@ -116,16 +144,10 @@ typedef void(^tValidationCompletion)(BOOL validated, NSError *error); @property (nonatomic, strong) NSURL *webpageURL; /** - * should be used by the app-delegate to forward handle application:openURL:sourceApplication:annotation calls - * - * @param url URL that was passed to the app - * @param sourceApplication sourceApplication that was passed to the app - * @param annotation annotation that was passed to the app - * - * @return YES if the URL request was handled, NO if the URL could not be handled/identified - * + * should be used by the app-delegate to forward handle application:openURL:sourceApplication:annotation: calls +* * Sample usage (in AppDelegate) - * - (BOOL)application:(UIApplication *)application + * - (BOOL)application:(UIApplication *)application * openURL:(NSURL *)url * sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { * if ([[BITHockeyManager sharedHockeyManager].authenticator handleOpenURL:url @@ -136,6 +158,12 @@ typedef void(^tValidationCompletion)(BOOL validated, NSError *error); * //do your own URL handling, return appropriate valu * } * return NO; + * + * @param url The URL that was passed to the app + * @param sourceApplication sourceApplication that was passed to the app + * @param annotation annotation that was passed to the app + * + * @return YES if the URL request was handled, NO if the URL could not be handled/identified } */ - (BOOL) handleOpenURL:(NSURL *) url @@ -144,6 +172,9 @@ typedef void(^tValidationCompletion)(BOOL validated, NSError *error); @end +/** + * BITAuthenticator protocol + */ @protocol BITAuthenticatorDelegate @optional diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 651c77ab95..85a0ac4492 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -170,7 +170,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato if(nil == jsonObject) { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:(jsonParseError ? @{NSUnderlyingErrorKey : jsonParseError} : nil)]; } return NO; @@ -178,7 +178,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato if(![jsonObject isKindOfClass:[NSDictionary class]]) { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:nil]; } return NO; @@ -204,7 +204,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato } else { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:nil]; } return NO; @@ -321,7 +321,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato typeof (self) strongSelf = weakSelf; if(nil == response) { NSError *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:@{ NSLocalizedDescriptionKey : BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerNetworkError") }]; @@ -410,7 +410,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato if(nil == jsonObject) { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:(jsonParseError ? @{NSUnderlyingErrorKey : jsonParseError} : nil)]; } return nil; @@ -418,7 +418,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato if(![jsonObject isKindOfClass:[NSDictionary class]]) { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:nil]; } return nil; @@ -427,7 +427,7 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato if(nil == status) { if(error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain - code:BITAuthenticatorAPIServerReturnedInvalidRespone + code:BITAuthenticatorAPIServerReturnedInvalidResponse userInfo:nil]; } return nil; diff --git a/Classes/BITAuthenticator_Private.h b/Classes/BITAuthenticator_Private.h index 99acf6fbc1..e85bcd264d 100644 --- a/Classes/BITAuthenticator_Private.h +++ b/Classes/BITAuthenticator_Private.h @@ -82,13 +82,16 @@ /** * if set, this serves as the installationIdentifier. * This is retrieved from the hockeyApp backend - * @see installationIdentifier + * @see installationIdentification */ @property (nonatomic, readonly) NSString *authenticationToken; /** * store the authentication token with the given type * if authToken is not nil, authentikationTokenType must also be non nil + * + * @param authenticationToken The authentication token + * @param authenticationTokenType The authentication token type */ - (void)setAuthenticationToken:(NSString *)authenticationToken withType:(NSString*) authenticationTokenType; @@ -107,11 +110,15 @@ /** * method registered as observer for applicationWillBecomeInactive events + * + * @param note NSNotification */ - (void) applicationWillResignActive:(NSNotification*) note; /** * method registered as observer for applicationsDidBecomeActive events + * + * @param note NSNotification */ - (void) applicationDidBecomeActive:(NSNotification*) note; diff --git a/Classes/BITFeedbackComposeViewControllerDelegate.h b/Classes/BITFeedbackComposeViewControllerDelegate.h index 0512925205..ab6f2aba9a 100644 --- a/Classes/BITFeedbackComposeViewControllerDelegate.h +++ b/Classes/BITFeedbackComposeViewControllerDelegate.h @@ -8,16 +8,25 @@ #import +/** + * The users action when composing a message + */ typedef NS_ENUM(NSUInteger, BITFeedbackComposeResult) { - BITFeedbackComposeResultCancelled, //user hit cancel - BITFeedbackComposeResultSubmitted, //user hit submit + /** + * user hit cancel + */ + BITFeedbackComposeResultCancelled, + /** + * user hit submit + */ + BITFeedbackComposeResultSubmitted, }; @class BITFeedbackComposeViewController; /** - The `BITFeedbackComposeViewControllerDelegate` formal protocol defines methods further configuring - the behaviour of `BITFeedbackComposeViewController`. + * The `BITFeedbackComposeViewControllerDelegate` formal protocol defines methods further configuring + * the behaviour of `BITFeedbackComposeViewController`. */ @protocol BITFeedbackComposeViewControllerDelegate @@ -29,18 +38,23 @@ typedef NS_ENUM(NSUInteger, BITFeedbackComposeResult) { ///----------------------------------------------------------------------------- /** - Invoked once the compose screen is finished via send or cancel - - If this is implemented, it's the responsibility of this method to dismiss the presented - `BITFeedbackComposeViewController` - - @param composeViewController The `BITFeedbackComposeViewController` instance invoking this delegate + * Invoked once the compose screen is finished via send or cancel + * + * If this is implemented, it's the responsibility of this method to dismiss the presented + * `BITFeedbackComposeViewController` + * + * @param composeViewController The `BITFeedbackComposeViewController` instance invoking this delegate + * @param composeResult The user action the lead to closing the compose view */ - (void)feedbackComposeViewController:(BITFeedbackComposeViewController *)composeViewController didFinishWithResult:(BITFeedbackComposeResult) composeResult; #pragma mark - Deprecated methods -/** this method is deprecated. If feedbackComposeViewController:didFinishWithResult: is implemented, this will not be called */ +/** + * This method is deprecated. If feedbackComposeViewController:didFinishWithResult: is implemented, this will not be called + * + * @param composeViewController The `BITFeedbackComposeViewController` instance invoking this delegate + */ - (void)feedbackComposeViewControllerDidFinish:(BITFeedbackComposeViewController *)composeViewController __attribute__((deprecated("Use feedbackComposeViewController:didFinishWithResult: instead"))); @end diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index dd2b4be5e1..a88bec4007 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -41,11 +41,23 @@ #define BITHockeyFeedbackMessagesLoadingFinished @"BITHockeyFeedbackMessagesLoadingFinished" -typedef enum { - BITFeedbackUserDataElementDontShow = 0, // don't ask for this user data element at all - BITFeedbackUserDataElementOptional = 1, // the user may provide it, but does not have to - BITFeedbackUserDataElementRequired = 2 // the user has to provide this to continue -} BITFeedbackUserDataElement; +/** + * Defines if behavior of the user data field + */ +typedef NS_ENUM(NSInteger, BITFeedbackUserDataElement) { + /** + * don't ask for this user data element at all + */ + BITFeedbackUserDataElementDontShow = 0, + /** + * the user may provide it, but does not have to + */ + BITFeedbackUserDataElementOptional = 1, + /** + * the user has to provide this to continue + */ + BITFeedbackUserDataElementRequired = 2 +}; @class BITFeedbackMessage; @@ -195,7 +207,7 @@ typedef enum { @see requireUserName @see requireUserEmail @see showFeedbackComposeView - @see feedbackComposeViewController: + @see feedbackComposeViewController @see showFeedbackListView @see feedbackListViewController: */ diff --git a/Classes/BITFeedbackMessage.h b/Classes/BITFeedbackMessage.h index e71f3f9248..dde73d6e12 100644 --- a/Classes/BITFeedbackMessage.h +++ b/Classes/BITFeedbackMessage.h @@ -29,20 +29,35 @@ #import -typedef enum { - // default and new messages from SDK per default +/** + * Status for each feedback message + */ +typedef NS_ENUM(NSInteger, BITFeedbackMessageStatus) { + /** + * default and new messages from SDK per default + */ BITFeedbackMessageStatusSendPending = 0, - // message is in conflict, happens if the message is already stored on the server and tried sending it again + /** + * message is in conflict, happens if the message is already stored on the server and tried sending it again + */ BITFeedbackMessageStatusInConflict = 1, - // sending of message is in progress + /** + * sending of message is in progress + */ BITFeedbackMessageStatusSendInProgress = 2, - // new messages from server + /** + * new messages from server + */ BITFeedbackMessageStatusUnread = 3, - // messages from server once read and new local messages once successful send from SDK + /** + * messages from server once read and new local messages once successful send from SDK + */ BITFeedbackMessageStatusRead = 4, - // message is archived, happens if the thread is deleted from the server + /** + * message is archived, happens if the thread is deleted from the server + */ BITFeedbackMessageStatusArchived = 5 -} BITFeedbackMessageStatus; +}; @interface BITFeedbackMessage : NSObject { } diff --git a/Classes/BITHockeyAppClient.h b/Classes/BITHockeyAppClient.h index 86b5ca8fc3..ab23aaf037 100644 --- a/Classes/BITHockeyAppClient.h +++ b/Classes/BITHockeyAppClient.h @@ -30,6 +30,9 @@ #import "BITHTTPOperation.h" //needed for typedef +/** + * Generic Hockey API client + */ @interface BITHockeyAppClient : NSObject /** diff --git a/Classes/BITHockeyBaseManagerPrivate.h b/Classes/BITHockeyBaseManagerPrivate.h index c925ee9982..cfb5038e14 100644 --- a/Classes/BITHockeyBaseManagerPrivate.h +++ b/Classes/BITHockeyBaseManagerPrivate.h @@ -26,10 +26,13 @@ /** Check if the device is running an iOS version previous to iOS 7 */ - (BOOL)isPreiOS7Environment; -/** by default, just logs the message - - can be overriden by subclasses to do their own error handling, - e.g. to show UI +/** + * by default, just logs the message + * + * can be overriden by subclasses to do their own error handling, + * e.g. to show UI + * + * @param error NSError */ - (void)reportError:(NSError *)error; @@ -40,19 +43,19 @@ */ - (NSString *)encodedAppIdentifier; -/** device / application helpers */ +// device / application helpers - (NSString *)getDevicePlatform; - (NSString *)executableUUID; -/** UI helpers */ +// UI helpers - (UINavigationController *)customNavigationControllerWithRootViewController:(UIViewController *)viewController presentationStyle:(UIModalPresentationStyle)presentationStyle; - (UIWindow *)findVisibleWindow; - (void)showView:(UIViewController *)viewController; -/** Date helpers */ +// Date helpers - (NSDate *)parseRFC3339Date:(NSString *)dateString; -/** keychain helpers */ +// keychain helpers - (BOOL)addStringValueToKeychain:(NSString *)stringValue forKey:(NSString *)key; - (NSString *)stringValueFromKeychainForKey:(NSString *)key; - (BOOL)removeKeyFromKeychain:(NSString *)key; diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index f8e2ca6b6c..3f9cc76d20 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -68,7 +68,7 @@ [[BITHockeyManager sharedHockeyManager] startManager]; @warning When also using the SDK for updating app versions (AdHoc or Enterprise) and collecting - beta usage analytics, you also have to use `[BITAuthenticator]`! + beta usage analytics, you also have to use `BITAuthenticator`! */ @@ -236,7 +236,7 @@ @see configureWithIdentifier:delegate: @see configureWithBetaIdentifier:liveIdentifier:delegate: @see startManager - @see disableStoreUpdateManager + @see enableStoreUpdateManager */ @property (nonatomic, strong, readonly) BITStoreUpdateManager *storeUpdateManager; diff --git a/Classes/BITHockeyManagerDelegate.h b/Classes/BITHockeyManagerDelegate.h index 70085833f4..f9995cc510 100644 --- a/Classes/BITHockeyManagerDelegate.h +++ b/Classes/BITHockeyManagerDelegate.h @@ -50,19 +50,21 @@ ///----------------------------------------------------------------------------- /** - Implement to force the usage of the live identifier - - This is useful if you are e.g. distributing an enterprise app inside your company - and want to use the `liveIdentifier` for that even though it is not running from - the App Store. - - Example: - - (BOOL)shouldUseLiveIdentifierForHockeyManager:(BITHockeyManager *)hockeyManager { - #ifdef (CONFIGURATION_AppStore) - return YES; - #endif - return NO; - } + * Implement to force the usage of the live identifier + * + * This is useful if you are e.g. distributing an enterprise app inside your company + * and want to use the `liveIdentifier` for that even though it is not running from + * the App Store. + * + * Example: + * - (BOOL)shouldUseLiveIdentifierForHockeyManager:(BITHockeyManager *)hockeyManager { + * #ifdef (CONFIGURATION_AppStore) + * return YES; + * #endif + * return NO; + * } + * + * @param hockeyManager BITHockeyManager instance */ - (BOOL)shouldUseLiveIdentifierForHockeyManager:(BITHockeyManager *)hockeyManager; diff --git a/Classes/BITStoreUpdateManager.h b/Classes/BITStoreUpdateManager.h index e4443a7bd9..134092d2f2 100644 --- a/Classes/BITStoreUpdateManager.h +++ b/Classes/BITStoreUpdateManager.h @@ -31,11 +31,23 @@ #import "BITHockeyBaseManager.h" -typedef enum { +/** + * Defines the update check intervals + */ +typedef NS_ENUM(NSInteger, BITStoreUpdateSetting) { + /** + * Check every day + */ BITStoreUpdateCheckDaily = 0, + /** + * Check every week + */ BITStoreUpdateCheckWeekly = 1, + /** + * Check manually + */ BITStoreUpdateCheckManually = 2 -} BITStoreUpdateSetting; +}; @protocol BITStoreUpdateManagerDelegate; @@ -142,7 +154,7 @@ typedef enum { the user about a new update being available in the App Store. If disabled, you need to implement the `BITStoreUpdateManagerDelegate` protocol with - the method `[BITStoreUpdateManagerDelegate detectUpdateFromStoreUpdateManager:version:]` + the method `[BITStoreUpdateManagerDelegate detectedUpdateFromStoreUpdateManager:newVersion:storeURL:]` to be notified about new version and proceed yourself. The manager will consider this identical to an `Ignore` user action using the alert and not inform about this particular version any more, unless the app is updated diff --git a/Classes/BITStoreUpdateManager.m b/Classes/BITStoreUpdateManager.m index f9ebd128b4..9888849d70 100644 --- a/Classes/BITStoreUpdateManager.m +++ b/Classes/BITStoreUpdateManager.m @@ -41,7 +41,7 @@ @implementation BITStoreUpdateManager { NSString *_newStoreVersion; - NSString *_appStoreURL; + NSString *_appStoreURLString; NSString *_currentUUID; BOOL _updateAlertShowing; @@ -92,7 +92,7 @@ _updateAlertShowing = NO; _updateUIEnabled = YES; _newStoreVersion = nil; - _appStoreURL = nil; + _appStoreURLString = nil; _currentUUID = [[self executableUUID] copy]; _countryCode = nil; @@ -162,7 +162,7 @@ _lastCheckFailed = NO; _newStoreVersion = [(NSDictionary *)[(NSArray *)[dictionary objectForKey:@"results"] objectAtIndex:0] objectForKey:@"version"]; - _appStoreURL = [(NSDictionary *)[(NSArray *)[dictionary objectForKey:@"results"] objectAtIndex:0] objectForKey:@"trackViewUrl"]; + _appStoreURLString = [(NSDictionary *)[(NSArray *)[dictionary objectForKey:@"results"] objectAtIndex:0] objectForKey:@"trackViewUrl"]; NSString *ignoredVersion = nil; if ([self.userDefaults objectForKey:kBITStoreUpdateIgnoreVersion]) { @@ -170,7 +170,7 @@ BITHockeyLog(@"INFO: Ignored version: %@", ignoredVersion); } - if (!_newStoreVersion || !_appStoreURL) { + if (!_newStoreVersion || !_appStoreURLString) { return NO; } else if (ignoredVersion && [ignoredVersion isEqualToString:_newStoreVersion]) { return NO; @@ -273,7 +273,7 @@ if ([self isUpdateAvailable]) { if (self.delegate && [self.delegate respondsToSelector:@selector(detectedUpdateFromStoreUpdateManager:newVersion:storeURL:)]) { - [self.delegate detectedUpdateFromStoreUpdateManager:self newVersion:_newStoreVersion storeURL:_appStoreURL]; + [self.delegate detectedUpdateFromStoreUpdateManager:self newVersion:_newStoreVersion storeURL:[NSURL URLWithString:_appStoreURLString]]; } if (self.updateUIEnabled && BITHockeyBundle()) { @@ -425,8 +425,8 @@ [self.userDefaults setObject:_newStoreVersion forKey:kBITStoreUpdateIgnoreVersion]; [self.userDefaults synchronize]; - if (_appStoreURL) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_appStoreURL]]; + if (_appStoreURLString) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_appStoreURLString]]; } else { BITHockeyLog(@"WARNING: The app store page couldn't be opened, since we did not get a valid URL from the store API."); } diff --git a/Classes/BITStoreUpdateManagerDelegate.h b/Classes/BITStoreUpdateManagerDelegate.h index 2454a34093..4051cfd458 100644 --- a/Classes/BITStoreUpdateManagerDelegate.h +++ b/Classes/BITStoreUpdateManagerDelegate.h @@ -52,7 +52,7 @@ @param newVersion The new version string reported by the App Store @param storeURL The App Store URL for this app that could be invoked to let them perform the update. */ --(void)detectedUpdateFromStoreUpdateManager:(BITStoreUpdateManager *)storeUpdateManager newVersion:(NSString *)newVersion storeURL:(NSString *)storeURL; +-(void)detectedUpdateFromStoreUpdateManager:(BITStoreUpdateManager *)storeUpdateManager newVersion:(NSString *)newVersion storeURL:(NSURL *)storeURL; diff --git a/Classes/BITUpdateManager.h b/Classes/BITUpdateManager.h index baf4ffe09c..e39f7c0196 100644 --- a/Classes/BITUpdateManager.h +++ b/Classes/BITUpdateManager.h @@ -32,11 +32,23 @@ #import "BITHockeyBaseManager.h" -typedef enum { +/** + * Update check interval + */ +typedef NS_ENUM (NSUInteger, BITUpdateSetting) { + /** + * On every startup or or when the app comes to the foreground + */ BITUpdateCheckStartup = 0, + /** + * Once a day + */ BITUpdateCheckDaily = 1, + /** + * Manually + */ BITUpdateCheckManually = 2 -} BITUpdateSetting; +}; @protocol BITUpdateManagerDelegate; diff --git a/Classes/BITUpdateViewControllerPrivate.h b/Classes/BITUpdateViewControllerPrivate.h index dfc58d633b..26b07244dd 100644 --- a/Classes/BITUpdateViewControllerPrivate.h +++ b/Classes/BITUpdateViewControllerPrivate.h @@ -34,13 +34,31 @@ #import "BITStoreButton.h" -typedef enum { +/** + * Button states + */ +typedef NS_ENUM(NSUInteger, AppStoreButtonState) { + /** + * Offline + */ AppStoreButtonStateOffline, + /** + * Check + */ AppStoreButtonStateCheck, + /** + * Searching + */ AppStoreButtonStateSearching, + /** + * Update + */ AppStoreButtonStateUpdate, + /** + * Installing + */ AppStoreButtonStateInstalling -} AppStoreButtonState; +}; @class BITUpdateManager; diff --git a/Classes/HockeySDK.h b/Classes/HockeySDK.h index 934f6fea58..b4a9c443b1 100644 --- a/Classes/HockeySDK.h +++ b/Classes/HockeySDK.h @@ -67,55 +67,132 @@ #define BITHockeyNetworkDidBecomeReachableNotification @"BITHockeyNetworkDidBecomeReachable" -// hockey crash reporting api error domain -typedef enum { +/** + * HockeySDK Crash Reporter error domain + */ +typedef NS_ENUM (NSInteger, BITCrashErrorReason) { + /** + * Unknown error + */ BITCrashErrorUnknown, + /** + * API Server rejected app version + */ BITCrashAPIAppVersionRejected, + /** + * API Server returned empty response + */ BITCrashAPIReceivedEmptyResponse, + /** + * Connection error with status code + */ BITCrashAPIErrorWithStatusCode -} BITCrashErrorReason; +}; extern NSString *const __attribute__((unused)) kBITCrashErrorDomain; -// hockey update api error domain -typedef enum { +/** + * HockeySDK Update error domain + */ +typedef NS_ENUM (NSInteger, BITUpdateErrorReason) { + /** + * Unknown error + */ BITUpdateErrorUnknown, + /** + * API Server returned invalid status + */ BITUpdateAPIServerReturnedInvalidStatus, + /** + * API Server returned invalid data + */ BITUpdateAPIServerReturnedInvalidData, + /** + * API Server returned empty response + */ BITUpdateAPIServerReturnedEmptyResponse, + /** + * Authorization secret missing + */ BITUpdateAPIClientAuthorizationMissingSecret, + /** + * No internet connection + */ BITUpdateAPIClientCannotCreateConnection -} BITUpdateErrorReason; +}; extern NSString *const __attribute__((unused)) kBITUpdateErrorDomain; -// hockey feedback api error domain -typedef enum { +/** + * HockeySDK Feedback error domain + */ +typedef NS_ENUM(NSInteger, BITFeedbackErrorReason) { + /** + * Unknown error + */ BITFeedbackErrorUnknown, + /** + * API Server returned invalid status + */ BITFeedbackAPIServerReturnedInvalidStatus, + /** + * API Server returned invalid data + */ BITFeedbackAPIServerReturnedInvalidData, + /** + * API Server returned empty response + */ BITFeedbackAPIServerReturnedEmptyResponse, + /** + * Authorization secret missing + */ BITFeedbackAPIClientAuthorizationMissingSecret, + /** + * No internet connection + */ BITFeedbackAPIClientCannotCreateConnection -} BITFeedbackErrorReason; +}; extern NSString *const __attribute__((unused)) kBITFeedbackErrorDomain; -// hockey Authenticator error domain +/** + * HockeySDK Authenticator error domain + */ typedef NS_ENUM(NSInteger, BITAuthenticatorReason) { + /** + * Unknown error + */ BITAuthenticatorErrorUnknown, + /** + * Network error + */ BITAuthenticatorNetworkError, - BITAuthenticatorAPIServerReturnedInvalidRespone, + /** + * API Server returned invalid response + */ + BITAuthenticatorAPIServerReturnedInvalidResponse, + /** + * Not Authorized + */ BITAuthenticatorNotAuthorized, + /** + * Authorization canceleed + */ BITAuthenticatorAuthenticationCancelled, + /** + * Authoraization secret missing + */ BITAuthenticatorAuthorizationSecretMissing, }; extern NSString *const __attribute__((unused)) kBITAuthenticatorErrorDomain; -// HockeySDK - -typedef enum { - BITHockeyErrorUnknown, - HockeyAPIClientMissingJSONLibrary -} BITHockeyErrorReason; +/** + * HockeySDK global error domain + */ +typedef NS_ENUM(NSInteger, BITHockeyErrorReason) { + /** + * Unknown error + */ + BITHockeyErrorUnknown +}; extern NSString *const __attribute__((unused)) kBITHockeyErrorDomain; diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index d7ddd956fc..d7c3a2730c 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -807,7 +807,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/usr/local/bin/appledoc \\\n --output \"${SOURCE_ROOT}/../documentation\" \\\n --ignore Vendor \\\n --ignore Products \\\n --ignore .m \\\n --create-html \\\n --create-docset \\\n --install-docset \\\n --keep-intermediate-files \\\n --project-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --project-version \"${VERSION_STRING}\" \\\n --project-company \"BitStadium GmbH\" \\\n --company-id \"de.bitstadium\" \\\n --docset-bundle-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --docset-feed-name \"${HOCKEYSDK_DOCSET_NAME}\" \\\n --docset-desc \"\" \\\n --docset-platform-family \"iphoneos\" \\\n --index-desc \"${SOURCE_ROOT}/../docs/index.md\" \\\n --include \"${SOURCE_ROOT}/../docs/index.html\" \\\n --include \"${SOURCE_ROOT}/../docs/\" \\\n --merge-categories \\\n --no-repeat-first-par \\\n --warn-undocumented-object \\\n --warn-undocumented-member \\\n --warn-empty-description \\\n --warn-unknown-directive \\\n --warn-invalid-crossref \\\n --warn-missing-arg \\\n --logformat xcode \\\n --exit-threshold 2 \\\n \"${SOURCE_ROOT}/../\"\n"; + shellScript = "/usr/local/bin/appledoc \\\n --output \"${SOURCE_ROOT}/../documentation\" \\\n --ignore Vendor \\\n --ignore Products \\\n --ignore Support \\\n --ignore .m \\\n --create-html \\\n --create-docset \\\n --install-docset \\\n --keep-intermediate-files \\\n --project-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --project-version \"${VERSION_STRING}\" \\\n --project-company \"BitStadium GmbH\" \\\n --company-id \"de.bitstadium\" \\\n --docset-bundle-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --docset-feed-name \"${HOCKEYSDK_DOCSET_NAME}\" \\\n --docset-desc \"\" \\\n --docset-platform-family \"iphoneos\" \\\n --index-desc \"${SOURCE_ROOT}/../docs/index.md\" \\\n --include \"${SOURCE_ROOT}/../docs/index.html\" \\\n --include \"${SOURCE_ROOT}/../docs/\" \\\n --merge-categories \\\n --no-repeat-first-par \\\n --warn-undocumented-object \\\n --warn-undocumented-member \\\n --warn-empty-description \\\n --warn-unknown-directive \\\n --warn-invalid-crossref \\\n --warn-missing-arg \\\n --logformat xcode \\\n --exit-threshold 2 \\\n \"${SOURCE_ROOT}/../\"\n"; }; 1EE9071A16F6871F003DDE1D /* ShellScript */ = { isa = PBXShellScriptBuildPhase; diff --git a/docs/Guide-Installation-Setup-Advanced-template.md b/docs/Guide-Installation-Setup-Advanced-template.md index e963b5842c..bc7788da8c 100644 --- a/docs/Guide-Installation-Setup-Advanced-template.md +++ b/docs/Guide-Installation-Setup-Advanced-template.md @@ -12,7 +12,6 @@ This document contains the following sections: - [Set up Git submodule](#download) - [Set up Xcode](#xcode) - [Modify Code](#modify) -- [Submit the UDID](#udid) - [Mac Desktop Uploader](#mac) - [Xcode Documentation](#documentation) @@ -136,22 +135,6 @@ If you need support for iOS 3.x, please check out [HockeyKit](http://support.hoc *Note:* The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that applicationDidFinishLaunching will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process. - -## Submit the UDID - -If you only want crash reporting, you can skip this step. If you want to use HockeyApp for beta distribution and analyze which testers have installed your app, you need to implement an additional delegate method in your AppDelegate.m: - - #pragma mark - BITUpdateManagerDelegate - - (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager { - #ifndef CONFIGURATION_AppStore - if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)]) - return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)]; - #endif - return nil; - } - -The method only returns the UDID when the build is not targeted to the App Sore. This assumes that a preprocessor macro name CONFIGURATION_AppStore exists and is set for App Store builds. The macros are already defined in `HockeySDK.xcconfig` or can be set manually by setting `GCC_PREPROCESSOR_DEFINITIONS` in your build configurations to `CONFIGURATION_$(CONFIGURATION)`. - ## Mac Desktop Uploader diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index f4c7f86a85..13146627b3 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -12,7 +12,6 @@ This document contains the following sections: - [Download & Extract](#download) - [Set up Xcode](#xcode) - [Modify Code](#modify) -- [Submit the UDID](#udid) - [Mac Desktop Uploader](#mac) - [Xcode Documentation](#documentation) @@ -107,22 +106,6 @@ If you need support for iOS 3.x, please check out [HockeyKit](http://support.hoc *Note:* The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that applicationDidFinishLaunching will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process. - -## Submit the UDID - -If you only want crash reporting, you can skip this step. If you want to use HockeyApp for beta distribution and analyze which testers have installed your app, you need to implement an additional delegate method in your AppDelegate.m: - - #pragma mark - BITUpdateManagerDelegate - - (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager { - #ifndef CONFIGURATION_AppStore - if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)]) - return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)]; - #endif - return nil; - } - -The method only returns the UDID when the build is not targeted to the App Sore. This assumes that a preprocessor macro name CONFIGURATION_AppStore exists and is set for App Store builds. The macros are already defined in `HockeySDK.xcconfig` or can be set manually by setting `GCC_PREPROCESSOR_DEFINITIONS` in your build configurations to `CONFIGURATION_$(CONFIGURATION)`. - ## Mac Desktop Uploader