# BITHockeyManagerDelegate Protocol Reference

Conforms to | # BITAuthenticatorDelegate BITCrashManagerDelegate BITFeedbackManagerDelegate BITUpdateManagerDelegate HOCKEYSDK_FEATURE_AUTHENTICATOR HOCKEYSDK_FEATURE_CRASH_REPORTER HOCKEYSDK_FEATURE_FEEDBACK HOCKEYSDK_FEATURE_UPDATES NSObject endif if
Declared in | BITHockeyManagerDelegate.h

## Overview

The `BITHockeyManagerDelegate` formal protocol defines methods further configuring the behaviour of `BITHockeyManager`, as well as the delegate of the modules it manages.

## Tasks

### App Identifier usage

- `– shouldUseLiveIdentifierForHockeyManager:`

### UI presentation

- `– viewControllerForHockeyManager:componentManager:`

### Additional meta data

- `– userIDForHockeyManager:componentManager:`
- `– userNameForHockeyManager:componentManager:`
- `– userEmailForHockeyManager:componentManager:`

## Instance Methods

### shouldUseLiveIdentifierForHockeyManager:

Implement to force the usage of the live identifier

`- (BOOL)shouldUseLiveIdentifierForHockeyManager:(BITHockeyManager *)hockeyManager`

#### Parameters

hockeyManager

  BITHockeyManager instance

#### Discussion

This is useful if you are e.g. distributing an enterprise app inside your company and want to use the `liveIdentifier` for that even though it is not running from the App Store.

Example:

     - (BOOL)shouldUseLiveIdentifierForHockeyManager:(BITHockeyManager *)hockeyManager {
     #ifdef (CONFIGURATION_AppStore)
       return YES;
     #endif
       return NO;
     }

#### Declared In

`BITHockeyManagerDelegate.h`

### userEmailForHockeyManager:componentManager:

Return the users email address that should used in the SDK components

`- (NSString *)userEmailForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager`

#### Parameters

hockeyManager

  The `BITHockeyManager` HockeyManager instance invoking this delegate

componentManager

  The `BITHockeyBaseManager` component instance invoking this delegate, can be `BITCrashManager` or `BITFeedbackManager`

#### 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.

In addition, if this returns not nil for `BITFeedbackManager` the user will not be asked for any user details by the component, including useerName or userEmail.

You can find out the component requesting the user email like this:

    - (NSString *)userEmailForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager {
      if (componentManager == hockeyManager.feedbackManager) {
        return UserEmailForFeedback;
      } else if (componentManager == hockeyManager.crashManager) {
        return UserEmailForCrashReports;
       } else {
        return nil;
       }
    }

For crash reports, this delegate is invoked on the startup after the crash!

Alternatively you can also use `[BITHockeyManager userEmail]` which will cache the value in the keychain.

Warning: When returning a non nil value for the `BITCrashManager` component, crash reports are not anonymous any more and the crash alerts will not show the word “anonymous”!

#### See Also

- `

  - userIDForHockeyManager:componentManager:

  `
- `

  - userNameForHockeyManager:componentManager:

  `
- `

  [BITHockeyManager userEmail]

  `

#### Declared In

`BITHockeyManagerDelegate.h`

### userIDForHockeyManager:componentManager:

Return the userid that should used in the SDK components

`- (NSString *)userIDForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager`

#### Parameters

hockeyManager

  The `BITHockeyManager` HockeyManager instance invoking this delegate

componentManager

  The `BITHockeyBaseManager` component instance invoking this delegate, can be `BITCrashManager` or `BITFeedbackManager`

#### 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.

In addition, if this returns not nil for `BITFeedbackManager` the user will not be asked for any user details by the component, including useerName or userEmail.

You can find out the component requesting the userID like this:

    - (NSString *)userIDForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager {
      if (componentManager == hockeyManager.feedbackManager) {
        return UserIDForFeedback;
      } else if (componentManager == hockeyManager.crashManager) {
        return UserIDForCrashReports;
      } else {
        return nil;
      }
    }

For crash reports, this delegate is invoked on the startup after the crash!

Alternatively you can also use `[BITHockeyManager userID]` which will cache the value in the keychain.

Warning: When returning a non nil value for the `BITCrashManager` component, crash reports are not anonymous any more and the crash alerts will not show the word “anonymous”!

#### See Also

- `

  - userNameForHockeyManager:componentManager:

  `
- `

  - userEmailForHockeyManager:componentManager:

  `
- `

  [BITHockeyManager userID]

  `

#### Declared In

`BITHockeyManagerDelegate.h`

### userNameForHockeyManager:componentManager:

Return the user name that should used in the SDK components

`- (NSString *)userNameForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager`

#### Parameters

hockeyManager

  The `BITHockeyManager` HockeyManager instance invoking this delegate

componentManager

  The `BITHockeyBaseManager` component instance invoking this delegate, can be `BITCrashManager` or `BITFeedbackManager`

#### 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.

In addition, if this returns not nil for `BITFeedbackManager` the user will not be asked for any user details by the component, including useerName or userEmail.

You can find out the component requesting the user name like this:

    - (NSString *)userNameForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager {
      if (componentManager == hockeyManager.feedbackManager) {
        return UserNameForFeedback;
      } else if (componentManager == hockeyManager.crashManager) {
        return UserNameForCrashReports;
      } else {
        return nil;
      }

}

For crash reports, this delegate is invoked on the startup after the crash!

Alternatively you can also use `[BITHockeyManager userName]` which will cache the value in the keychain.

Warning: When returning a non nil value for the `BITCrashManager` component, crash reports are not anonymous any more and the crash alerts will not show the word “anonymous”!

#### See Also

- `

  - userIDForHockeyManager:componentManager:

  `
- `

  - userEmailForHockeyManager:componentManager:

  `
- `

  [BITHockeyManager userName]

  `

#### Declared In

`BITHockeyManagerDelegate.h`

### viewControllerForHockeyManager:componentManager:

Return a custom parent view controller for presenting modal sheets

`- (UIViewController *)viewControllerForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager`

#### Parameters

hockeyManager

  The `BITHockeyManager` HockeyManager instance invoking this delegate

componentManager

  The `BITHockeyBaseManager` component instance invoking this delegate, can be `BITCrashManager` or `BITFeedbackManager`

#### Discussion

By default the SDK is using the root UIWindow instance to present any required view controllers. Overwrite this if this doesn’t result in a satisfying behavior or if you want to define any other parent view controller.

#### Declared In

`BITHockeyManagerDelegate.h`