From 6aeb2050638d0faa97478654620a4175b6e6191f Mon Sep 17 00:00:00 2001 From: Thomas Dohmke Date: Sat, 3 Dec 2011 16:56:22 +0100 Subject: [PATCH] Added delegate methods from BWHockeyManager and BWQuincyManager to CNSHockeyManagerDelegate. --- Classes/CNSHockeyManager.h | 60 ++++++++++++++++++++++++++++++++++++++ Classes/CNSHockeyManager.m | 6 ++-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/Classes/CNSHockeyManager.h b/Classes/CNSHockeyManager.h index 8d34f1eb98..7bfca575d2 100644 --- a/Classes/CNSHockeyManager.h +++ b/Classes/CNSHockeyManager.h @@ -19,11 +19,65 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +@class BWHockeyManager; + @protocol CNSHockeyManagerDelegate @optional + +// Invoked when the manager is configured +// +// Implement to force the usage of the live identifier, e.g. for enterprise apps +// which are distributed inside your company - (BOOL)shouldUseLiveIdenfitier; +// Invoked when the internet connection is started +// +// Implement to let the delegate enable the activity indicator +- (void)connectionOpened; + +// Invoked when the internet connection is closed +// +// Implement to let the delegate disable the activity indicator +- (void)connectionClosed; + +// Invoked via the alert view to define the presenting view controller +// +// Default is the root view controller of the main window instance +- (UIViewController *)viewControllerForHockeyController:(BWHockeyManager *)hockeyController; + +// Invoked before a crash report will be sent +// +// Return a userid or similar which the crashreport should contain +// +// Maximum length: 255 chars +// +// Default: empty +- (NSString *)crashReportUserID; + +// Invoked before a crash report will be sent +// +// Return contact data, e.g. an email address, for the crash report +// Maximum length: 255 chars +// +// Default: empty +-(NSString *) crashReportContact; + +// Invoked before a crash report will be sent +// +// Return a the description for the crashreport should contain; the string +// will automatically be wrapped into <[DATA[ ]]>, so make sure you don't do +// that in your string. +// +// Default: empty +-(NSString *) crashReportDescription; + +// Invoked before the user is asked to send a crash report +// +// Implement to do additional actions, e.g. to make sure to not to ask the +// user for an app rating :) +- (void)willShowSubmitCrashReportAlert; + @end @@ -33,9 +87,15 @@ NSString *appIdentifier; } +// Returns the shared manager object + (CNSHockeyManager *)sharedHockeyManager; +// Configure HockeyApp with a single app identifier and delegate; use this +// only for debug or beta versions of your app! - (void)configureWithIdentifier:(NSString *)appIdentifier delegate:(id)delegate; + +// Configure HockeyApp with different app identifiers for beta and live versions +// of the app; the update alert will only be shown for the beta identifier - (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id)delegate; @end diff --git a/Classes/CNSHockeyManager.m b/Classes/CNSHockeyManager.m index 53bcc2aa60..13fb75ae17 100644 --- a/Classes/CNSHockeyManager.m +++ b/Classes/CNSHockeyManager.m @@ -121,7 +121,8 @@ #pragma mark - Public Instance Methods -- (void)configureWithIdentifier:(NSString *)newAppIdentifier delegate:(id)delegate { +- (void)configureWithIdentifier:(NSString *)newAppIdentifier delegate:(id)newDelegate { + delegate = newDelegate; [appIdentifier release]; appIdentifier = [newAppIdentifier copy]; @@ -129,7 +130,8 @@ [self configureHockeyManager]; } -- (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id)delegate { +- (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id)newDelegate { + delegate = newDelegate; [appIdentifier release]; if ([self shouldUseLiveIdenfitier]) {