# BITStoreUpdateManager Class Reference

Inherits from | BITHockeyBaseManager : NSObject
Declared in | BITStoreUpdateManager.h

## Overview

The store update manager module.

This is the HockeySDK module for handling app updates when having your app released in the App Store. By default the module uses the current users locale to define the app store to check for updates. You can modify this using the `countryCode` property. See the property documentation for details on its usage.

When an update is detected, this module will show an alert asking the user if he/she wants to update or ignore this version. If update was chosen, it will open the apps page in the app store app.

You need to enable this module using `[BITHockeyManager enableStoreUpdateManager]` if you want to use this feature. By default this module is disabled!

When this module is enabled and NOT running in an App Store build/environment, it won’t do any checks!

The `BITStoreUpdateManagerDelegate` protocol informs the app about new detected app versions.

Warning: This module can NOT check if the current device and OS version match the minimum requirements of the new app version!

## Tasks

### Delegate

- `delegate` property

### Update Checking

- `updateSetting` property
- `countryCode` property
- `checkForUpdateOnLaunch` property

### User Interface

- `updateUIEnabled` property

### Manual update checking

- `– checkForUpdate`

## Properties

### checkForUpdateOnLaunch

Flag that determines whether the automatic update checks should be done.

`@property (nonatomic, assign, getter=isCheckingForUpdateOnLaunch) BOOL checkForUpdateOnLaunch`

#### Discussion

If this is enabled the update checks will be performed automatically depending on the `updateSetting` property. If this is disabled the `updateSetting` property will have no effect, and checking for updates is totally up to be done by yourself.

Default: YES

Warning: When setting this to `NO` you need to invoke update checks yourself!

#### See Also

- `

  @property updateSetting

  `
- `

  @property countryCode

  `
- `

  - checkForUpdate

  `

#### Declared In

`BITStoreUpdateManager.h`

### countryCode

Defines the store country the app is always available in, otherwise uses the users locale

`@property (nonatomic, strong) NSString *countryCode`

#### Discussion

If this value is not defined, then it uses the device country if the current locale.

If you are pre-defining a country and are releasing a new version on a specific date, it can happen that users get an alert but the update is not yet available in their country!

But if a user downloaded the app from another appstore than the locale is set and the app is not available in the locales app store, then the user will never receive an update notification!

More information about possible country codes is available here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

#### See Also

- `

  @property updateSetting

  `
- `

  @property checkForUpdateOnLaunch

  `
- `

  - checkForUpdate

  `

#### Declared In

`BITStoreUpdateManager.h`

### delegate

Sets the optional `BITStoreUpdateManagerDelegate` delegate.

`@property (nonatomic, weak) id delegate`

#### Declared In

`BITStoreUpdateManager.h`

### updateSetting

When to check for new updates.

`@property (nonatomic, assign) BITStoreUpdateSetting updateSetting`

#### Discussion

Defines when a the SDK should check if there is a new update available on the server. This must be assigned one of the following, see `BITStoreUpdateSetting`:

- `BITStoreUpdateCheckDaily`: Once a day
- `BITStoreUpdateCheckWeekly`: Once a week
- `BITStoreUpdateCheckManually`: Manually

Default: BITStoreUpdateCheckWeekly

Warning: When setting this to `BITStoreUpdateCheckManually` you need to either invoke the update checking process yourself with `checkForUpdate` somehow, e.g. by proving an update check button for the user or integrating the Update View into your user interface.

#### See Also

- `

  BITStoreUpdateSetting

  `
- `

  @property countryCode

  `
- `

  @property checkForUpdateOnLaunch

  `
- `

  - checkForUpdate

  `

#### Declared In

`BITStoreUpdateManager.h`

### updateUIEnabled

Flag that determines if the integrated update alert should be used

`@property (nonatomic, assign, getter=isUpdateUIEnabled) BOOL updateUIEnabled`

#### Discussion

If enabled, the integrated UIAlert based update notification will be used to inform the user about a new update being available in the App Store.

If disabled, you need to implement the `BITStoreUpdateManagerDelegate` protocol with the method `[BITStoreUpdateManagerDelegate detectedUpdateFromStoreUpdateManager:newVersion:storeURL:]` to be notified about new version and proceed yourself. The manager will consider this identical to an `Ignore` user action using the alert and not inform about this particular version any more, unless the app is updated and this very same version shows up at a later time again as a new version.

Default: YES

Warning: If the HockeySDKResources bundle is missing in the application package, then the internal update alert is also disabled and be treated identical to manually disabling this property.

#### See Also

- `

  @property updateSetting

  `

#### Declared In

`BITStoreUpdateManager.h`

## Instance Methods

### checkForUpdate

Check for an update

`- (void)checkForUpdate`

#### Discussion

Call this to trigger a check if there is a new update available on the HockeyApp servers.

#### See Also

- `

  @property updateSetting

  `
- `

  @property countryCode

  `
- `

  @property checkForUpdateOnLaunch

  `

#### Declared In

`BITStoreUpdateManager.h`