mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Various documentation fixes and updates
This commit is contained in:
parent
67a4e1b6f9
commit
d7ae69860d
@ -31,6 +31,9 @@
|
||||
@class BITAuthenticator;
|
||||
@class BITHockeyAppClient;
|
||||
|
||||
/**
|
||||
* View controller handling user interaction for `BITAuthenticator`
|
||||
*/
|
||||
@interface BITAuthenticationViewController : UITableViewController
|
||||
|
||||
- (instancetype) initWithDelegate:(id<BITAuthenticationViewControllerDelegate>) delegate;
|
||||
@ -61,6 +64,9 @@
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* BITAuthenticationViewController protocol
|
||||
*/
|
||||
@protocol BITAuthenticationViewControllerDelegate<NSObject>
|
||||
|
||||
/**
|
||||
|
||||
@ -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 <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -8,16 +8,25 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* 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 <NSObject>
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
*/
|
||||
|
||||
@ -29,20 +29,35 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
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 {
|
||||
}
|
||||
|
||||
@ -30,6 +30,9 @@
|
||||
|
||||
#import "BITHTTPOperation.h" //needed for typedef
|
||||
|
||||
/**
|
||||
* Generic Hockey API client
|
||||
*/
|
||||
@interface BITHockeyAppClient : NSObject
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.");
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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.
|
||||
|
||||
<a id="udid"></a>
|
||||
## 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)`.
|
||||
|
||||
<a id="mac"></a>
|
||||
## Mac Desktop Uploader
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
<a id="udid"></a>
|
||||
## 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)`.
|
||||
|
||||
<a id="mac"></a>
|
||||
## Mac Desktop Uploader
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user