Contents

defaultStatusForCategory:error:

Reports whether this app is the person’s default app in the given category.

Declaration

- (UIApplicationCategoryDefaultStatus) defaultStatusForCategory:(UIApplicationCategory) category error:(NSError **) error;

Parameters

  • category:

    The type of app for which you test whether your app is the default.

  • error:

    If an error occurs, upon return contains an Nserror object that describes the problem. If you are not interested in possible errors, pass in NULL.

Return Value

If the system could determine the status of the app, this method returns UIApplicationCategoryDefaultStatusIsDefault if the app is the default app in the category, and UIApplicationCategoryDefaultStatusNotDefault otherwise. If the system couldn’t determine the status, or the app has exceeded the threshold rate for calling this method, it returns UIApplicationCategoryDefaultStatusUnavailable and supplies more information about the problem in error.

Discussion

To reduce the likelihood that users will face continuous requests to set a browser as their default, this API will only tell the browser app if it is the default once per year. If you call the method too frequently, it throws an error with the domain UIApplicationCategoryDefaultErrorDomain and the code rateLimited. The error’s info dictionary contains these keys:

UIApplicationCategoryDefaultStatusLastProvidedDateErrorKey

The date at which the app most recently received a UIApplicationCategoryDefaultStatusIsDefault or UIApplicationCategoryDefaultStatusNotDefault response from this method.

UIApplicationCategoryDefaultRetryAvailabilityDateErrorKey

The date at which the app can next request an updated response.

See Also

Discovering if your app is the default app in a category