Add warnings to the console for the last commit

Notify the developer about the issues by logging a warning to the console when the SDK is initialized more than once or startManager is invoked multiple times
This commit is contained in:
Andreas Linde 2014-08-26 17:37:24 +02:00
parent d7e17d2f1c
commit b2a40717c0

View File

@ -212,7 +212,10 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h
- (void)startManager {
if (!_validAppIdentifier) return;
if (_startManagerIsInvoked) return;
if (_startManagerIsInvoked) {
NSLog(@"[HockeySDK] Warning: startManager should only be invoked once! This call is ignored.");
return;
}
if (![self isSetUpOnMainThread]) return;
@ -588,7 +591,10 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h
}
- (void)initializeModules {
if (_managersInitialized) return;
if (_managersInitialized) {
NSLog(@"[HockeySDK] Warning: The SDK should only be initialized once! This call is ignored.");
return;
}
_validAppIdentifier = [self checkValidityOfAppIdentifier:_appIdentifier];