Moved public API from BWHockeyManager to CNSHockeyManager. Fixed name of isShowingDirectInstallOption.

This commit is contained in:
Thomas Dohmke 2011-12-03 17:57:16 +01:00
parent 1446d31588
commit 2884bdf354
4 changed files with 243 additions and 10 deletions

View File

@ -111,13 +111,7 @@ typedef enum {
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
// settings // Setting Properties
// if YES, the API will return an existing JMC config
// if NO, the API will return only version information
@property (nonatomic, assign) BOOL checkForTracker;
@property (nonatomic, retain, readonly) NSDictionary *trackerConfig;
// if YES, states will be logged using NSLog. Only enable this for debugging! // if YES, states will be logged using NSLog. Only enable this for debugging!
// if NO, nothing will be logged. (default) // if NO, nothing will be logged. (default)
@ -157,7 +151,7 @@ typedef enum {
// if YES, the alert notifying about an new update also shows a button to install the update directly // if YES, the alert notifying about an new update also shows a button to install the update directly
// if NO, the alert notifying about an new update only shows ignore and show update button // if NO, the alert notifying about an new update only shows ignore and show update button
@property (nonatomic, assign, getter=ishowingDirectInstallOption) BOOL showDirectInstallOption; @property (nonatomic, assign, getter=isShowingDirectInstallOption) BOOL showDirectInstallOption;
// if YES, each app version needs to be authorized by the server to run on this device // if YES, each app version needs to be authorized by the server to run on this device
// if NO, each app version does not need to be authorized (default) // if NO, each app version does not need to be authorized (default)
@ -172,7 +166,17 @@ typedef enum {
@property (nonatomic, assign) HockeyUpdateSetting updateSetting; @property (nonatomic, assign) HockeyUpdateSetting updateSetting;
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
// Private Properties
// if YES, the API will return an existing JMC config
// if NO, the API will return only version information
@property (nonatomic, assign) BOOL checkForTracker;
// Contains the tracker config if received from server
@property (nonatomic, retain, readonly) NSDictionary *trackerConfig;
// if YES the app is installed from the app store
// if NO the app is installed via ad-hoc or enterprise distribution
@property (nonatomic, readonly) BOOL isAppStoreEnvironment; @property (nonatomic, readonly) BOOL isAppStoreEnvironment;
// is an update available? // is an update available?

View File

@ -537,7 +537,7 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain";
otherButtonTitles:BWHockeyLocalize(@"HockeyShowUpdate"), nil otherButtonTitles:BWHockeyLocalize(@"HockeyShowUpdate"), nil
] autorelease]; ] autorelease];
BW_IF_IOS4_OR_GREATER( BW_IF_IOS4_OR_GREATER(
if (self.ishowingDirectInstallOption) { if (self.isShowingDirectInstallOption) {
[alertView addButtonWithTitle:BWHockeyLocalize(@"HockeyInstallUpdate")]; [alertView addButtonWithTitle:BWHockeyLocalize(@"HockeyInstallUpdate")];
} }
) )

View File

@ -19,7 +19,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
@class BWHockeyManager; #import "BWHockeyManager.h"
#pragma mark - Delegate
@protocol CNSHockeyManagerDelegate <NSObject> @protocol CNSHockeyManagerDelegate <NSObject>
@ -86,6 +88,8 @@
NSString *appIdentifier; NSString *appIdentifier;
} }
#pragma mark - Public Properties
// Custom language style; set to a string which will be appended to // Custom language style; set to a string which will be appended to
// to the localization file name; the Hockey SDK includes an alternative // to the localization file name; the Hockey SDK includes an alternative
// file, to use this, set to @"Alternate" // file, to use this, set to @"Alternate"
@ -93,6 +97,11 @@
// Default: nil // Default: nil
@property (nonatomic, retain) NSString *languageStyle; @property (nonatomic, retain) NSString *languageStyle;
// Enable debug logging; ONLY ENABLE THIS FOR DEBUGGING!
//
// Default: NO
@property (nonatomic, assign, getter=isLoggingEnabled) BOOL loggingEnabled;
// Show button "Always" in crash alert; this will cause the dialog not to // Show button "Always" in crash alert; this will cause the dialog not to
// show the alert description text landscape mode! (default) // show the alert description text landscape mode! (default)
// //
@ -118,6 +127,72 @@
// Default: NO // Default: NO
@property (nonatomic, assign, getter=isAutoSubmitDeviceUDID) BOOL autoSubmitDeviceUDID; @property (nonatomic, assign, getter=isAutoSubmitDeviceUDID) BOOL autoSubmitDeviceUDID;
// Send user data to HockeyApp when checking for a new version; works only
// for beta apps and should not be activated for live apps. User data includes
// the device type, OS version, app version and device UDID.
//
// Default: YES
@property (nonatomic, assign, getter=shouldSendUserData) BOOL sendUserData;
// Send usage time to HockeyApp when checking for a new version; works only
// for beta apps and should not be activated for live apps.
//
// Default: YES
@property (nonatomic, assign, getter=shouldSendUsageTime) BOOL sendUsageTime;
// Enable to allow the user to change the settings from the update view
//
// Default: YES
@property (nonatomic, assign, getter=shouldShowUserSettings) BOOL showUserSettings;
// Allow the user to disable the sending of user data; this settings should
// only be set if showUserSettings is enabled.
//
// Default: YES
@property (nonatomic, assign, getter=isUserAllowedToDisableSendData) BOOL allowUserToDisableSendData;
// Enable to show the new version alert every time the app becomes active and
// the current version is outdated
//
// Default: YES
@property (nonatomic, assign) BOOL alwaysShowUpdateReminder;
// Enable to check for a new version every time the app becomes active; if
// disabled you need to trigger the update mechanism manually
//
// Default: YES
@property (nonatomic, assign, getter=shouldCheckForUpdateOnLaunch) BOOL checkForUpdateOnLaunch;
// Show a button "Install" in the update alert to let the user directly start
// the update; note that the user will not see the release notes.
//
// Default: NO
@property (nonatomic, assign, getter=isShowingDirectInstallOption) BOOL showDirectInstallOption;
// Enable to check on the server that the app is authorized to run on this
// device; the check is based on the UDID and the authentication secret which
// is shown on the app page on HockeyApp
//
// Default: NO
@property (nonatomic, assign, getter=shouldRequireAuthorization) BOOL requireAuthorization;
// Set to the authentication secret which is shown on the app page on HockeyApp;
// must be set if requireAuthorization is enabled; leave empty otherwise
//
// Default: nil
@property (nonatomic, retain) NSString *authenticationSecret;
// Define how the client determines if a new version is available.
//
// Values:
// HockeyComparisonResultDifferent - the version on the server is different
// HockeyComparisonResultGreate - the version on the server is greater
//
// Default: HockeyComparisonResultGreater
@property (nonatomic, assign) HockeyComparisonResult compareVersionType;
#pragma mark - Public Methods
// Returns the shared manager object // Returns the shared manager object
+ (CNSHockeyManager *)sharedHockeyManager; + (CNSHockeyManager *)sharedHockeyManager;
@ -132,4 +207,32 @@
// Returns true if the app crashes in the last session // Returns true if the app crashes in the last session
- (BOOL)didCrashInLastSession; - (BOOL)didCrashInLastSession;
// Returns true if an update is available
- (BOOL)isUpdateAvailable;
// Returns true if update check is running
- (BOOL)isCheckInProgress;
// Show update info view
- (void)showUpdateView;
// Manually start an update check
- (void)checkForUpdate;
// Checks for update and informs the user if an update was found or an
// error occurred
- (void)checkForUpdateShowFeedback:(BOOL)feedback;
// Initiates app-download call; this displays an alert view of the OS
- (BOOL)initiateAppDownload;
// Returns true if this app version was authorized with the server
- (BOOL)appVersionIsAuthorized;
// Manually check if the device is authorized to run this version
- (void)checkForAuthorization;
// Return a new instance of BWHockeyViewController
- (BWHockeyViewController *)hockeyViewController:(BOOL)modal;
@end @end

View File

@ -147,6 +147,14 @@
} }
} }
- (BOOL)isLoggingEnabled {
return [[BWHockeyManager sharedHockeyManager] isLoggingEnabled];
}
- (void)setLoggingEnabled:(BOOL)loggingEnabled {
return [[BWHockeyManager sharedHockeyManager] setLoggingEnabled:loggingEnabled];
}
#pragma mark - Public Instance Methods (Crash Reporting) #pragma mark - Public Instance Methods (Crash Reporting)
- (NSString *)languageStyle { - (NSString *)languageStyle {
@ -193,6 +201,124 @@
return [[BWQuincyManager sharedQuincyManager] didCrashInLastSession]; return [[BWQuincyManager sharedQuincyManager] didCrashInLastSession];
} }
#pragma mark - Public Instance Methods (Distribution)
- (BOOL)shouldSendUserData {
return [[BWHockeyManager sharedHockeyManager] shouldSendUserData];
}
- (void)setSendUserData:(BOOL)sendUserData {
[[BWHockeyManager sharedHockeyManager] setSendUserData:sendUserData];
}
- (BOOL)shouldSendUsageTime {
return [[BWHockeyManager sharedHockeyManager] shouldSendUsageTime];
}
- (void)setSendUsageTime:(BOOL)sendUsageTime {
[[BWHockeyManager sharedHockeyManager] setSendUsageTime:sendUsageTime];
}
- (BOOL)shouldShowUserSettings {
return [[BWHockeyManager sharedHockeyManager] shouldShowUserSettings];
}
- (void)setShowUserSettings:(BOOL)showUserSettings {
[[BWHockeyManager sharedHockeyManager] setShowUserSettings:showUserSettings];
}
- (BOOL)isUserAllowedToDisableSendData {
return [[BWHockeyManager sharedHockeyManager] isAllowUserToDisableSendData];
}
- (void)setAllowUserToDisableSendData:(BOOL)allowUserToDisableSendData {
[[BWHockeyManager sharedHockeyManager] setAllowUserToDisableSendData:allowUserToDisableSendData];
}
- (BOOL)alwaysShowUpdateReminder {
return [[BWHockeyManager sharedHockeyManager] alwaysShowUpdateReminder];
}
- (void)setAlwaysShowUpdateReminder:(BOOL)alwaysShowUpdateReminder {
[[BWHockeyManager sharedHockeyManager] setAlwaysShowUpdateReminder:alwaysShowUpdateReminder];
}
- (BOOL)shouldCheckForUpdateOnLaunch {
return [[BWHockeyManager sharedHockeyManager] isCheckForUpdateOnLaunch];
}
- (void)setCheckForUpdateOnLaunch:(BOOL)checkForUpdateOnLaunch {
[[BWHockeyManager sharedHockeyManager] setCheckForUpdateOnLaunch:checkForUpdateOnLaunch];
}
- (BOOL)isShowingDirectInstallOption {
return [[BWHockeyManager sharedHockeyManager] isShowingDirectInstallOption];
}
- (void)setShowDirectInstallOption:(BOOL)showDirectInstallOption {
[[BWHockeyManager sharedHockeyManager] setShowDirectInstallOption:showDirectInstallOption];
}
- (BOOL)shouldRequireAuthorization {
return [[BWHockeyManager sharedHockeyManager] isRequireAuthorization];
}
- (void)setRequireAuthorization:(BOOL)requireAuthorization {
[[BWHockeyManager sharedHockeyManager] setRequireAuthorization:requireAuthorization];
}
- (NSString *)authenticationSecret {
return [[BWHockeyManager sharedHockeyManager] authenticationSecret];
}
- (void)setAuthenticationSecret:(NSString *)authenticationSecret {
[[BWHockeyManager sharedHockeyManager] setAuthenticationSecret:authenticationSecret];
}
- (HockeyComparisonResult)compareVersionType {
return [[BWHockeyManager sharedHockeyManager] compareVersionType];
}
- (void)setCompareVersionType:(HockeyComparisonResult)compareVersionType {
[[BWHockeyManager sharedHockeyManager] setCompareVersionType:compareVersionType];
}
- (BOOL)isUpdateAvailable {
return [[BWHockeyManager sharedHockeyManager] isUpdateAvailable];
}
- (BOOL)isCheckInProgress {
return [[BWHockeyManager sharedHockeyManager] isCheckInProgress];
}
- (void)showUpdateView {
[[BWHockeyManager sharedHockeyManager] showUpdateView];
}
- (void)checkForUpdate {
[[BWHockeyManager sharedHockeyManager] checkForUpdate];
}
- (void)checkForUpdateShowFeedback:(BOOL)feedback {
[[BWHockeyManager sharedHockeyManager] checkForUpdateShowFeedback:feedback];
}
- (BOOL)initiateAppDownload {
return [[BWHockeyManager sharedHockeyManager] initiateAppDownload];
}
- (BOOL)appVersionIsAuthorized {
return [[BWHockeyManager sharedHockeyManager] appVersionIsAuthorized];
}
- (void)checkForAuthorization {
[[BWHockeyManager sharedHockeyManager] checkForAuthorization];
}
- (BWHockeyViewController *)hockeyViewController:(BOOL)modal {
return [[BWHockeyManager sharedHockeyManager] hockeyViewController:modal];
}
#pragma mark - Private Instance Methods #pragma mark - Private Instance Methods
- (BOOL)shouldUseLiveIdenfitier { - (BOOL)shouldUseLiveIdenfitier {