BITHockeyManager Class Reference
Inherits from | NSObject |
Declared in | BITHockeyManager.h |
Overview
The HockeySDK manager. Responsible for setup and management of all components
This is the principal SDK class. It represents the entry point for the HockeySDK. The main promises of the class are initializing the SDK modules, providing access to global properties and to all modules. Initialization is divided into several distinct phases:
- Setup the HockeyApp app identifier and the optional delegate: This is the least required information on setting up the SDK and using it. It does some simple validation of the app identifier and checks if the app is running from the App Store or not. If the Atlassian JMC framework is found, it will disable its Crash Reporting module and configure it with the Jira configuration data from HockeyApp.
- Provides access to the SDK modules
BITCrashManager
,BITUpdateManager
, andBITFeedbackManager
. This way all modules can be further configured to personal needs, if the defaults don’t fit the requirements. - Configure each module.
- Start up all modules.
The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that applicationDidFinishLaunching will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process.
All modules do NOT show any user interface if the module is not activated or not integrated.
BITCrashManager
: Shows an alert on startup asking the user if he/she agrees on sending the crash report, if [BITCrashManager crashManagerStatus]
is set to BITCrashManagerStatusAlwaysAsk
(default)
BITUpdateManager
: Is automatically deactivated when the SDK detects it is running from a build distributed via the App Store. Otherwise if it is not deactivated manually, it will show an alert after startup informing the user about a pending update, if one is available. If the user then decides to view the update another screen is presented with further details and an option to install the update.
BITFeedbackManager
: If this module is deactivated or the user interface is nowhere added into the app, this module will not do anything. It will not fetch the server for data or show any user interface. If it is integrated, activated, and the user already used it to provide feedback, it will show an alert after startup if a new answer has been received from the server with the option to view it.
Example:
[[BITHockeyManager sharedHockeyManager]
configureWithIdentifier:@"<AppIdentifierFromHockeyApp>"
delegate:nil];
[[BITHockeyManager sharedHockeyManager] startManager];
Warning: The SDK is NOT thread safe and has to be set up on the main thread!
Warning: You should NOT change any module configuration after calling startManager
!
Tasks
Initialization
-
+ sharedHockeyManager
-
– configureWithIdentifier:
-
– configureWithIdentifier:delegate:
-
– configureWithBetaIdentifier:liveIdentifier:delegate:
-
– startManager
Modules
-
delegate
property -
serverURL
property -
crashManager
property -
disableCrashManager
property -
updateManager
property -
disableUpdateManager
property -
storeUpdateManager
property -
enableStoreUpdateManager
property -
feedbackManager
property -
disableFeedbackManager
property -
authenticator
property
Environment
-
appStoreEnvironment
property -
installString
property
Debug Logging
-
debugLogEnabled
property
Integration test
Additional meta data
SDK meta data
Properties
appStoreEnvironment
Flag that determines whether the application is installed and running from an App Store installation.
@property (nonatomic, readonly, getter=isAppStoreEnvironment) BOOL appStoreEnvironment
Discussion
Returns YES if the app is installed and running from the App Store Returns NO if the app is installed via debug, ad-hoc or enterprise distribution
Declared In
BITHockeyManager.h
authenticator
Reference to the initialized BITAuthenticator module
@property (nonatomic, strong, readonly) BITAuthenticator *authenticator
Discussion
Returns the BITAuthenticator instance initialized by BITHockeyManager
See Also
Declared In
BITHockeyManager.h
crashManager
Reference to the initialized BITCrashManager module
@property (nonatomic, strong, readonly) BITCrashManager *crashManager
Discussion
Returns the BITCrashManager instance initialized by BITHockeyManager
See Also
Declared In
BITHockeyManager.h
debugLogEnabled
Flag that determines whether additional logging output should be generated by the manager and all modules.
@property (nonatomic, assign, getter=isDebugLogEnabled) BOOL debugLogEnabled
Discussion
This is ignored if the app is running in the App Store and reverts to the default value in that case.
Default: NO
Declared In
BITHockeyManager.h
delegate
Set the delegate
@property (nonatomic, weak) id<BITHockeyManagerDelegate> delegate
Discussion
Defines the class that implements the optional protocol BITHockeyManagerDelegate
.
See Also
Declared In
BITHockeyManager.h
disableCrashManager
Flag the determines whether the Crash Manager should be disabled
@property (nonatomic, getter=isCrashManagerDisabled) BOOL disableCrashManager
Discussion
If this flag is enabled, then crash reporting is disabled and no crashes will be send.
Please note that the Crash Manager will be initialized anyway!
Default: NO
See Also
Declared In
BITHockeyManager.h
disableFeedbackManager
Flag the determines whether the Feedback Manager should be disabled
@property (nonatomic, getter=isFeedbackManagerDisabled) BOOL disableFeedbackManager
Discussion
If this flag is enabled, then letting the user give feedback and get responses will be turned off!
Please note that the Feedback Manager will be initialized anyway!
Default: NO
See Also
Declared In
BITHockeyManager.h
disableUpdateManager
Flag the determines whether the Update Manager should be disabled
@property (nonatomic, getter=isUpdateManagerDisabled) BOOL disableUpdateManager
Discussion
If this flag is enabled, then checking for updates and submitting beta usage analytics will be turned off!
Please note that the Update Manager will be initialized anyway!
Default: NO
See Also
Declared In
BITHockeyManager.h
enableStoreUpdateManager
Flag the determines whether the App Store Update Manager should be enabled
@property (nonatomic, getter=isStoreUpdateManagerEnabled) BOOL enableStoreUpdateManager
Discussion
If this flag is enabled, then checking for updates when the app runs from the app store will be turned on!
Please note that the Store Update Manager will be initialized anyway!
Default: NO
See Also
Declared In
BITHockeyManager.h
feedbackManager
Reference to the initialized BITFeedbackManager module
@property (nonatomic, strong, readonly) BITFeedbackManager *feedbackManager
Discussion
Returns the BITFeedbackManager instance initialized by BITHockeyManager
See Also
Declared In
BITHockeyManager.h
installString
Returns the app installation specific anonymous UUID
@property (nonatomic, readonly) NSString *installString
Discussion
The value returned by this method is unique and persisted per app installation
in the keychain. It is also being used in crash reports as CrashReporter Key
and internally when sending crash reports and feedback messages.
This is not identical to the [ASIdentifierManager advertisingIdentifier]
or
the [UIDevice identifierForVendor]
!
Declared In
BITHockeyManager.h
serverURL
Defines the server URL to send data to or request data from
@property (nonatomic, strong) NSString *serverURL
Discussion
By default this is set to the HockeyApp servers and there rarely should be a need to modify that.
Declared In
BITHockeyManager.h
storeUpdateManager
Reference to the initialized BITStoreUpdateManager module
@property (nonatomic, strong, readonly) BITStoreUpdateManager *storeUpdateManager
Discussion
Returns the BITStoreUpdateManager instance initialized by BITHockeyManager
See Also
Declared In
BITHockeyManager.h
updateManager
Reference to the initialized BITUpdateManager module
@property (nonatomic, strong, readonly) BITUpdateManager *updateManager
Discussion
Returns the BITUpdateManager instance initialized by BITHockeyManager
See Also
Declared In
BITHockeyManager.h
userEmail
Set the users email address that should used in the SDK components
@property (nonatomic, retain) NSString *userEmail
Discussion
Right now this is used by the BITCrashManager
to attach to a crash report.
BITFeedbackManager
uses it too for assigning the user to a discussion thread.
The value can be set at any time and will be stored in the keychain on the current
device only! To delete the value from the keychain set the value to nil
.
This property is optional and can be used as an alternative to the delegate. If you want to define specific data for each component, use the delegate instead which does overwrite the values set by this property.
Warning: When returning a non nil value, crash reports are not anonymous any more and the crash alerts will not show the word “anonymous”!
See Also
[BITHockeyManagerDelegate userEmailForHockeyManager:componentManager:]
Declared In
BITHockeyManager.h
userID
Set the userid that should used in the SDK components
@property (nonatomic, retain) NSString *userID
Discussion
Right now this is used by the BITCrashManager
to attach to a crash report.
BITFeedbackManager
uses it too for assigning the user to a discussion thread.
The value can be set at any time and will be stored in the keychain on the current
device only! To delete the value from the keychain set the value to nil
.
This property is optional and can be used as an alternative to the delegate. If you want to define specific data for each component, use the delegate instead which does overwrite the values set by this property.
See Also
[BITHockeyManagerDelegate userIDForHockeyManager:componentManager:]
Declared In
BITHockeyManager.h
userName
Set the user name that should used in the SDK components
@property (nonatomic, retain) NSString *userName
Discussion
Right now this is used by the BITCrashManager
to attach to a crash report.
BITFeedbackManager
uses it too for assigning the user to a discussion thread.
The value can be set at any time and will be stored in the keychain on the current
device only! To delete the value from the keychain set the value to nil
.
This property is optional and can be used as an alternative to the delegate. If you want to define specific data for each component, use the delegate instead which does overwrite the values set by this property.
Warning: When returning a non nil value, crash reports are not anonymous any more and the crash alerts will not show the word “anonymous”!
See Also
[BITHockeyManagerDelegate userNameForHockeyManager:componentManager:]
Declared In
BITHockeyManager.h
Instance Methods
build
Returns the SDK Build (CFBundleVersion) as a string.
- (NSString *)build
Declared In
BITHockeyManager.h
configureWithBetaIdentifier:liveIdentifier:delegate:
Initializes the manager with an app identifier for beta, one for live usage and delegate
- (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(NSString *)liveIdentifier delegate:(id<BITHockeyManagerDelegate>)delegate
Parameters
- betaIdentifier
The app identifier for the non app store (beta) configurations
- liveIdentifier
The app identifier for the app store configurations.
- delegate
nil
or the class implementing the optional protocols
Discussion
Initialize the manager with different HockeyApp app identifiers for beta and live usage.
All modules will automatically detect if the app is running in the App Store and use
the live app identifier for that. In all other cases it will use the beta app identifier.
And also assign the class that implements the optional protocols BITHockeyManagerDelegate
,
BITCrashManagerDelegate
or BITUpdateManagerDelegate
[[BITHockeyManager sharedHockeyManager]
configureWithBetaIdentifier:@"<AppIdentifierForBetaAppFromHockeyApp>"
liveIdentifier:@"<AppIdentifierForLiveAppFromHockeyApp>"
delegate:nil];
We recommend using one app entry on HockeyApp for your beta versions and another one for your live versions. The reason is that you will have way more beta versions than live versions, but on the other side get way more crash reports on the live version. Separating them into two different app entries makes it easier to work with the data. In addition you will likely end up having the same version number for a beta and live version which would mix different data into the same version. Also the live version does not require you to upload any IPA files, uploading only the dSYM package for crash reporting is just fine.
See Also
Declared In
BITHockeyManager.h
configureWithIdentifier:
Initializes the manager with a particular app identifier
- (void)configureWithIdentifier:(NSString *)appIdentifier
Parameters
- appIdentifier
The app identifier that should be used.
Discussion
Initialize the manager with a HockeyApp app identifier.
[[BITHockeyManager sharedHockeyManager]
configureWithIdentifier:@"<AppIdentifierFromHockeyApp>"];
See Also
Declared In
BITHockeyManager.h
configureWithIdentifier:delegate:
Initializes the manager with a particular app identifier and delegate
- (void)configureWithIdentifier:(NSString *)appIdentifier delegate:(id<BITHockeyManagerDelegate>)delegate
Parameters
- appIdentifier
The app identifier that should be used.
- delegate
nil
or the class implementing the option protocols
Discussion
Initialize the manager with a HockeyApp app identifier and assign the class that
implements the optional protocols BITHockeyManagerDelegate
, BITCrashManagerDelegate
or
BITUpdateManagerDelegate
.
[[BITHockeyManager sharedHockeyManager]
configureWithIdentifier:@"<AppIdentifierFromHockeyApp>"
delegate:nil];
See Also
Declared In
BITHockeyManager.h
startManager
Starts the manager and runs all modules
- (void)startManager
Discussion
Call this after configuring the manager and setting up all modules.
Declared In
BITHockeyManager.h
testIdentifier
Pings the server with the HockeyApp app identifiers used for initialization
- (void)testIdentifier
Discussion
Call this method once for debugging purposes to test if your SDK setup code reaches the server successfully.
Once invoked, check the apps page on HockeyApp for a verification.
If you setup the SDK with a beta and live identifier, a call to both app IDs will be done.
This call is ignored if the app is running in the App Store!.
Declared In
BITHockeyManager.h