mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Make module managers readonly and change another property to proper naming
This commit is contained in:
parent
a26e4899d3
commit
3ab4fb6eaf
@ -47,14 +47,14 @@
|
|||||||
|
|
||||||
#pragma mark - Public Properties
|
#pragma mark - Public Properties
|
||||||
|
|
||||||
@property (nonatomic, retain) BITCrashManager *crashManager;
|
@property (nonatomic, retain, readonly) BITCrashManager *crashManager;
|
||||||
|
|
||||||
@property (nonatomic, retain) BITUpdateManager *updateManager;
|
@property (nonatomic, retain, readonly) BITUpdateManager *updateManager;
|
||||||
|
|
||||||
|
|
||||||
// if YES the app is installed from the app store
|
// if YES the app is installed from the app store
|
||||||
// if NO the app is installed via ad-hoc or enterprise distribution
|
// if NO the app is installed via ad-hoc or enterprise distribution
|
||||||
@property (nonatomic, readonly) BOOL isAppStoreEnvironment;
|
@property (nonatomic, readonly, getter=isAppStoreEnvironment) BOOL appStoreEnvironment;
|
||||||
|
|
||||||
// Enable debug logging; ONLY ENABLE THIS FOR DEBUGGING!
|
// Enable debug logging; ONLY ENABLE THIS FOR DEBUGGING!
|
||||||
//
|
//
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
@synthesize crashManager = _crashManager;
|
@synthesize crashManager = _crashManager;
|
||||||
@synthesize updateManager = _updateManager;
|
@synthesize updateManager = _updateManager;
|
||||||
|
|
||||||
@synthesize isAppStoreEnvironment = _isAppStoreEnvironment;
|
@synthesize appStoreEnvironment = _appStoreEnvironment;
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - Public Class Methods
|
#pragma mark - Public Class Methods
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
- (id) init {
|
- (id) init {
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
_isAppStoreEnvironment = NO;
|
_appStoreEnvironment = NO;
|
||||||
_startManagerIsInvoked = NO;
|
_startManagerIsInvoked = NO;
|
||||||
|
|
||||||
[self performSelector:@selector(validateStartManagerIsInvoked) withObject:nil afterDelay:0.0f];
|
[self performSelector:@selector(validateStartManagerIsInvoked) withObject:nil afterDelay:0.0f];
|
||||||
@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)validateStartManagerIsInvoked {
|
- (void)validateStartManagerIsInvoked {
|
||||||
if (_validAppIdentifier && !_isAppStoreEnvironment) {
|
if (_validAppIdentifier && !_appStoreEnvironment) {
|
||||||
if (!_startManagerIsInvoked) {
|
if (!_startManagerIsInvoked) {
|
||||||
NSLog(@"ERROR: You did not call [[BITHockeyManager sharedHockeyManager] startManager] to startup the HockeySDK! Please do so after setting up all properties. The SDK is NOT running.");
|
NSLog(@"ERROR: You did not call [[BITHockeyManager sharedHockeyManager] startManager] to startup the HockeySDK! Please do so after setting up all properties. The SDK is NOT running.");
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@
|
|||||||
delegateResult = [(NSObject <BITHockeyManagerDelegate>*)delegate shouldUseLiveIdenfitier];
|
delegateResult = [(NSObject <BITHockeyManagerDelegate>*)delegate shouldUseLiveIdenfitier];
|
||||||
}
|
}
|
||||||
|
|
||||||
return (delegateResult) || (_isAppStoreEnvironment);
|
return (delegateResult) || (_appStoreEnvironment);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initializeModules {
|
- (void)initializeModules {
|
||||||
@ -150,23 +150,23 @@
|
|||||||
|
|
||||||
// check if we are really not in an app store environment
|
// check if we are really not in an app store environment
|
||||||
if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
|
if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
|
||||||
_isAppStoreEnvironment = NO;
|
_appStoreEnvironment = NO;
|
||||||
} else {
|
} else {
|
||||||
_isAppStoreEnvironment = YES;
|
_appStoreEnvironment = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TARGET_IPHONE_SIMULATOR
|
#if TARGET_IPHONE_SIMULATOR
|
||||||
_isAppStoreEnvironment = NO;
|
_appStoreEnvironment = NO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_startManagerIsInvoked = NO;
|
_startManagerIsInvoked = NO;
|
||||||
|
|
||||||
if (_validAppIdentifier) {
|
if (_validAppIdentifier) {
|
||||||
BITHockeyLog(@"Setup CrashManager");
|
BITHockeyLog(@"Setup CrashManager");
|
||||||
self.crashManager = [[[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier] autorelease];
|
_crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier];
|
||||||
|
|
||||||
BITHockeyLog(@"Setup UpdateManager");
|
BITHockeyLog(@"Setup UpdateManager");
|
||||||
self.updateManager = [[[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_isAppStoreEnvironment] autorelease];
|
_updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment];
|
||||||
|
|
||||||
// Only if JMC is part of the project
|
// Only if JMC is part of the project
|
||||||
if ([[self class] isJMCPresent]) {
|
if ([[self class] isJMCPresent]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user