Skip to content

Instantly share code, notes, and snippets.

@leovandriel
Created October 8, 2012 10:42
Show Gist options
  • Save leovandriel/3851904 to your computer and use it in GitHub Desktop.
Save leovandriel/3851904 to your computer and use it in GitHub Desktop.
A HockeyApp delegate class
// A HockeyApp delegate class.
// License: Public Domain
// Author: Leonard van Driel, 2012
#import <HockeySDK/HockeySDK.h>
@interface NWHockeyChief : NSObject <BITHockeyManagerDelegate, BITUpdateManagerDelegate, BITCrashManagerDelegate>
+ (NWHockeyChief *)shared;
+ (void)setup;
@end
@implementation NWHockeyChief
+ (NWHockeyChief *)shared
{
static NWHockeyChief *result = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
result = [[NWHockeyChief alloc] init];
});
return result;
}
+ (void)setup
{
[BITHockeyManager.sharedHockeyManager configureWithBetaIdentifier:@"" liveIdentifier:@"" delegate:self];
[BITHockeyManager.sharedHockeyManager.crashManager setCrashManagerStatus:BITCrashManagerStatusAutoSend];
[BITHockeyManager.sharedHockeyManager startManager];
}
- (NSString *)userNameForCrashManager:(BITCrashManager *)crashManager
{
return @"TODO: user name";
}
// TODO: remove in App Store
- (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager
{
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)]) {
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
}
return nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment