Added delegate methods from BWHockeyManager and BWQuincyManager to CNSHockeyManagerDelegate.

This commit is contained in:
Thomas Dohmke 2011-12-03 16:56:22 +01:00
parent b6f00765df
commit 6aeb205063
2 changed files with 64 additions and 2 deletions

View File

@ -19,11 +19,65 @@
// 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;
@protocol CNSHockeyManagerDelegate <NSObject> @protocol CNSHockeyManagerDelegate <NSObject>
@optional @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; - (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 @end
@ -33,9 +87,15 @@
NSString *appIdentifier; NSString *appIdentifier;
} }
// Returns the shared manager object
+ (CNSHockeyManager *)sharedHockeyManager; + (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; - (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; - (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id)delegate;
@end @end

View File

@ -121,7 +121,8 @@
#pragma mark - Public Instance Methods #pragma mark - Public Instance Methods
- (void)configureWithIdentifier:(NSString *)newAppIdentifier delegate:(id)delegate { - (void)configureWithIdentifier:(NSString *)newAppIdentifier delegate:(id)newDelegate {
delegate = newDelegate;
[appIdentifier release]; [appIdentifier release];
appIdentifier = [newAppIdentifier copy]; appIdentifier = [newAppIdentifier copy];
@ -129,7 +130,8 @@
[self configureHockeyManager]; [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]; [appIdentifier release];
if ([self shouldUseLiveIdenfitier]) { if ([self shouldUseLiveIdenfitier]) {