# Titanium.App.iOS

> The top-level App iOS module, available only to iOS devices, that includes the facilities to create and manage local notifications and background services.

- Source: https://titaniumsdk.com/docs/sdk/13.4.0/Titanium.App.iOS
- Titanium SDK version: 13.4.0
- Kind: module
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 1.5.0, iPad 1.5.0, macOS 9.2.0
- Extends: Titanium.Module
- Inheritance: Titanium.Module > Titanium.Proxy

### Local Notifications

Local notifications are a way for an application that is not running in the foreground to let
users know that it has information for them. When invoked, the application either displays a
banner message or an alert dialog with a **Close** button to dismiss and an **Open** button to bring the application
into the foreground. The application can also modify the icon badge, to show the
number of pending notifications, and generate a sound.

To send a local notification, the application needs to:

  1. Enroll the application to send local notifications with the
     [Titanium.App.iOS.registerUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#registerUserNotificationSettings) method.
  2. Schedule a local notification with the [Titanium.App.iOS.scheduleLocalNotification](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#scheduleLocalNotification) method.
  3. Monitor the [notification](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#notification) event to respond to the
     notification.

For instructions on sending local interactive notifications, see the
[iOS Local Notifications guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Notification_Services/iOS_Local_Notifications.html).

### Local Interactive Notifications

You can create interactive notifications, where users can respond to application notifications
without launching the application to the foreground. The user needs to reveal notification
actions in the notification, then press a notification action to respond to the notification.

To create an interactive notification, the application needs to:

  1. Create and configure notification actions with the
     [Titanium.App.iOS.createUserNotificationAction](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#createUserNotificationAction) method.
  2. Create notification categories and assign notification actions to them
     with the [Titanium.App.iOS.createUserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#createUserNotificationCategory) method.
  3. Register the notification categories with the
     [Titanium.App.iOS.registerUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#registerUserNotificationSettings) method.
  4. Monitor the [localnotificationaction](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#localnotificationaction) event.

For instructions on sending local interactive notifications, see the
[iOS Local Notifications guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Notification_Services/iOS_Local_Notifications.html).

### Background Downloads

In iOS 7, Apple introduced new background execution modes which allow the application to download
content in the background. These background modes are supported in Titanium SDK 3.2.0 and later.

For more information on getting started, refer to the
[iOS Background Services guide](https://titaniumsdk.com/guide/Titanium_SDK/Titanium_SDK_How-tos/Platform_API_Deep_Dives/iOS_API_Deep_Dives/iOS_Background_Services.html).

### Handoff User Activities

Handoff allows you to create and transfer user activities from one device to another. For example, you can start editing
a document on your phone, then transfer the activity to your iPad to continue editing the document.

To make an activity shareable, use the [Titanium.App.iOS.UserActivity](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserActivity.md) API to create the activity.
To continue the activity on another device, listen for the
[continueactivity](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#continueactivity) event.

### Index Application Content

In iOS 9 and later, Apple lets you index application content, such as music, videos, images and documents, to allow it
to be searched in iOS Spotlight. To effectively add and remove information from the iOS search index
you will need to use the following APIs:

* [Titanium.App.iOS.SearchableItemAttributeSet](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItemAttributeSet.md) - Used to create metadata related to the `Ti.App.iOS.SearchableItem`
* [Titanium.App.iOS.SearchableItem](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItem.md) - Used to assemble metadata into a unique object package to be used by `Ti.App.iOS.SearchableIndex`
* [Titanium.App.iOS.SearchableIndex](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableIndex.md) - Used to add and remove `Ti.App.iOS.SearchableItem` objects to the device search index

## Properties

### applicationOpenSettingsURL

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

Returns a URL to open the app's settings.

Used to create a URL that you can pass to the [openURL](https://titaniumsdk.com/docs/sdk/Titanium.Platform.md#openURL) method.
When you open the URL built from this string, the system launches the Settings app and displays the app's custom settings, if it has any.

``` js
var settingsURL = Ti.App.iOS.applicationOpenSettingsURL;
if (Ti.Platform.canOpenURL(settingsURL)) {
    Ti.Platform.openURL(settingsURL);
}
```

### BACKGROUNDFETCHINTERVAL_MIN

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0
- Permission: read-only

Use with [setMinimumBackgroundFetchInterval](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#setMinimumBackgroundFetchInterval) method.
Specifies the smallest fetch interval supported by the system.

### BACKGROUNDFETCHINTERVAL_NEVER

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0
- Permission: read-only

Use with [setMinimumBackgroundFetchInterval](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#setMinimumBackgroundFetchInterval) method.
Used to specify a fetch interval large enough to prevent fetch operations from occurring.

### currentUserNotificationSettings

- Type: UserNotificationSettings
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only
- DEPRECATED since 7.3.0. Use [Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings) instead.

Notification types and user notification categories the application is registered to use.

### EVENT_ACCESSIBILITY_LAYOUT_CHANGED

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.0.0
- Permission: read-only

Convenience constant for system event "accessibilitylayoutchanged".

### EVENT_ACCESSIBILITY_SCREEN_CHANGED

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.0.0
- Permission: read-only

Convenience constant for system event "accessibilityscreenchanged".

### supportedUserActivityTypes

- Type: Array<String>
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only

Provides an Array of the NSUserActivityTypes keys defined within your Titanium project.

Used to obtain a list of the NSUserActivityTypes keys defined in your Titanium project's tiapp.xml file.
These NSUserActivityTypes keys are the keys which you can use working with iOS Titanium User Activities.
NSUserActivityTypes must be defined at build time in your tiapp.xml file as shown below:

``` xml
<ios>
  <plist>
  <dict>
    <key>NSUserActivityTypes</key>
      <array>
        [string](https://titaniumsdk.com/docs/sdk/Global.String.md)com.setdirection.home</string>
        [string](https://titaniumsdk.com/docs/sdk/Global.String.md)com.setdirection.shelf</string>
        [string](https://titaniumsdk.com/docs/sdk/Global.String.md)com.setdirection.item</string>
      </array>
    </dict>
    </plist>
  </ios>
```

### USER_INTERFACE_STYLE_DARK

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 8.2.0
- Requires: iOS 13.0+
- Permission: read-only
- DEPRECATED since 9.1.0. Use <Titanium.UI.USER_INTERFACE_STYLE_DARK> instead, which is supported cross-platform.

A dark interface style.

Used in the `userInterfaceStyle` property.

### USER_INTERFACE_STYLE_LIGHT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 8.2.0
- Requires: iOS 13.0+
- Permission: read-only
- DEPRECATED since 9.1.0. Use <Titanium.UI.USER_INTERFACE_STYLE_LIGHT> instead, which is supported cross-platform.

A light interface style.

Used in the `userInterfaceStyle` property.

### USER_INTERFACE_STYLE_UNSPECIFIED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 8.2.0
- Requires: iOS 13.0+
- Permission: read-only
- DEPRECATED since 9.1.0. Use <Titanium.UI.USER_INTERFACE_STYLE_UNSPECIFIED> instead, which is supported cross-platform.

An unspecified interface style.

Used in the `userInterfaceStyle` property.

### USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The action will execute in background. Use with the
[activationMode](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md#activationMode) property.

### USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The action will launch the application and execute in the foreground.
Use with the [activationMode](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md#activationMode) property.

### USER_NOTIFICATION_ALERT_STYLE_ALERT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

A alert dialog is presented when the notification is received.

Used to check the `alertStyle` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_ALERT_STYLE_BANNER

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

A banner is presented when the notification is received.

Used to check the `alertStyle` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_ALERT_STYLE_NONE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

No banner or alert dialog is presented when the notification is received.

Used to check the `alertStyle` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_AUTHORIZATION_STATUS_AUTHORIZED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The application is authorized to post user notifications.

Used to check the `authorizationStatus` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_AUTHORIZATION_STATUS_DENIED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The application is not authorized to post user notifications.

Used to check the `authorizationStatus` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_AUTHORIZATION_STATUS_NOT_DETERMINED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The user has not yet made a choice regarding whether the application may post
user notifications.

Used to check the `authorizationStatus` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_AUTHORIZATION_STATUS_PROVISIONAL

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.4.0
- Permission: read-only

The application is provisionally authorized to post non-interruptive user notifications.

Used to check the `authorizationStatus` attribute received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_BEHAVIOR_DEFAULT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.1.0
- Permission: read-only

Default action behavior with no additional action support.

Use with the [behavior](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md#behavior) property.

### USER_NOTIFICATION_BEHAVIOR_TEXTINPUT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.1.0
- Permission: read-only

Provides a textfield with the notification for the user to enter a text response.

The user input will be passed to the `typedText` field of the object passed to the callback
handling the `localnotification` event.

Use with the [behavior](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md#behavior) property.

### USER_NOTIFICATION_CATEGORY_OPTION_ALLOW_IN_CARPLAY

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

Allow CarPlay to display notifications of this type.

Used in the `options` attribute when creating a [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

### USER_NOTIFICATION_CATEGORY_OPTION_CUSTOM_DISMISS_ACTION

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

Send dismiss actions to the UNUserNotificationCenter object's delegate for handling.

Used in the `options` attribute when creating a [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

### USER_NOTIFICATION_CATEGORY_OPTION_HIDDEN_PREVIEWS_SHOW_SUBTITLE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

Show the notification's subtitle, even if the user has disabled notification previews for the app.

Used in the `options` attribute when creating a [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

### USER_NOTIFICATION_CATEGORY_OPTION_HIDDEN_PREVIEWS_SHOW_TITLE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

Show the notification's title, even if the user has disabled notification previews for the app.

Used in the `options` attribute when creating a [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

### USER_NOTIFICATION_CATEGORY_OPTION_NONE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

No options.

Used in the `options` attribute when creating a [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

### USER_NOTIFICATION_SETTING_DISABLED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The notification setting is turned off.

Used to check application-wide enabled notification settings received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_SETTING_ENABLED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The notification setting is turned on.

Used to check application-wide enabled notification settings received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_SETTING_NOT_SUPPORTED

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.3.0
- Permission: read-only

The application does not support this notification type.

Used to check application-wide enabled notification settings received in
[Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCenter.md#requestUserNotificationSettings).

### USER_NOTIFICATION_TYPE_ALERT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The application may display an alert upon a notification being received.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_BADGE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The application may badge its icon upon a notification being received.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_CRITICAL_ALERT

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.4.0
- Permission: read-only

The ability to play sounds for critical alerts.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_NONE

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The application may not present any UI upon a notification being received.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_PROVIDES_APP_NOTIFICATION_SETTINGS

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.4.0
- Permission: read-only

An option indicating the system should display a button for in-app notification settings.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_PROVISIONAL

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 7.4.0
- Permission: read-only

The ability to post non-interrupting notifications provisionally to the Notification Center.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### USER_NOTIFICATION_TYPE_SOUND

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0
- Permission: read-only

The application may play a sound upon a notification being received.
Use with the [types](https://titaniumsdk.com/docs/sdk/UserNotificationSettings.md#types) property.

### userInterfaceStyle

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 8.2.0
- Requires: iOS 13.0+
- Permission: read-only
- DEPRECATED since 9.1.0. Use <Titanium.UI.userInterfaceStyle> instead, which is supported cross-platform.

The style associated with the user interface.

Use this property to determine whether your interface should be configured with a dark or light appearance.
The default value of this trait is set to the corresponding appearance setting on the user's device.

Accepts: `Titanium.App.iOS.USER_INTERFACE_STYLE_DARK`, `Titanium.App.iOS.USER_INTERFACE_STYLE_LIGHT`, `Titanium.App.iOS.USER_INTERFACE_STYLE_UNSPECIFIED`

### UTTYPE_APPLE_ICNS

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.icns"`

Uniform type identifier for macOS icon images.

### UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only

Uniform type identifier for Apple-protected MPEG-4 audio.

### UTTYPE_AUDIO

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.audio"`

Uniform type identifier for all audio content.

### UTTYPE_BMP

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.microsoft.bmp"`

Uniform type identifier for Windows bitmap images.

### UTTYPE_FLAT_RTFD

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.flat-rtfd"`

Uniform type identifier for Rich Text with content embedding, pasteboard format.

### UTTYPE_GIF

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.compuserve.gif"`

Uniform type identifier for GIF images.

### UTTYPE_HTML

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.html"`

Uniform type identifier for HTML.

### UTTYPE_ICO

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.microsoft.ico"`

Uniform type identifier for Windows icon images.

### UTTYPE_IMAGE

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.image"`

Uniform type identifier for all image types.

### UTTYPE_JPEG

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.jpeg"`

Uniform type identifier for JPEG images.

### UTTYPE_JPEG2000

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.jpeg-2000"`

Uniform type identifier for JPEG 2000 images.

### UTTYPE_MOVIE

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.movie"`

Uniform type identifier for all audiovisual content.

### UTTYPE_MP3

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.mp3"`

Uniform type identifier for MP3 audio.

### UTTYPE_MPEG

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.mpeg"`

Uniform type identifier for MPEG-1 and MPEG-2 content.

### UTTYPE_MPEG4

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.mpeg-4"`

Uniform type identifier for MPEG-4 content.

### UTTYPE_MPEG4_AUDIO

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.mpeg-4-audio"`

Uniform type identifier for MPEG-4 audio.

### UTTYPE_PDF

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.adobe.pdf"`

Uniform type identifier for PDF data.

### UTTYPE_PICT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.pict"`

Uniform type identifier for PICT images.

### UTTYPE_PLAIN_TEXT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.plain-text"`

Uniform type identifier for a plain text type, equivalent to MIME type text/plain.

### UTTYPE_PNG

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.png"`

Uniform type identifier for PNG images.

### UTTYPE_QUICKTIME_IMAGE

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.quicktime-image"`

Uniform type identifier for QuickTime images.

### UTTYPE_QUICKTIME_MOVIE

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.quicktime-movie"`

Uniform type identifier for QuickTime movies.

### UTTYPE_RTF

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.rtf"`

Uniform type identifier for Rich Text.

### UTTYPE_RTFD

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.rtfd"`

Uniform type identifier for Rich Text Format Directory, that is, Rich Text with content embedding, on-disk format.

### UTTYPE_TEXT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.text"`

Uniform type identifier for all text types.

### UTTYPE_TIFF

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.tiff"`

Uniform type identifier for TIFF images.

### UTTYPE_TXN_TEXT_AND_MULTIMEDIA_DATA

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only

Uniform type identifier for MLTE (Textension) format for mixed text and multimedia data.

### UTTYPE_UTF16_EXTERNAL_PLAIN_TEXT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only

Uniform type identifier for Unicode-16 with byte-order mark (BOM), or if BOM is not present,
an external representation byte order (big-endian).

### UTTYPE_UTF16_PLAIN_TEXT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only

Uniform type identifier for Unicode-16, native byte order, with an optional byte-order mark (BOM).

### UTTYPE_UTF8_PLAIN_TEXT

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.utf8-plain-text"`

Uniform type identifier for Unicode-8 plain text type.

### UTTYPE_VIDEO

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.video"`

Uniform type identifier for all video content without audio.

### UTTYPE_WEB_ARCHIVE

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"com.apple.webarchive"`

Uniform type identifier for WebKit webarchive format.

### UTTYPE_XML

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Permission: read-only
- Value: `"public.xml"`

Uniform type identifier for XML.

## Methods

### cancelAllLocalNotifications

- Platforms: iPhone, iPad, macOS
- DEPRECATED since 7.3.0. Use [Titanium.App.iOS.UserNotificationCenter.removePendingNotifications](Titanium.App.iOS.UserNotificationCenter.removePendingNotifications) instead.

Cancels all scheduled local notifications.

### cancelLocalNotification

- Platforms: iPhone, iPad, macOS
- DEPRECATED since 7.3.0. Use [Titanium.App.iOS.UserNotificationCenter.removePendingNotifications](Titanium.App.iOS.UserNotificationCenter.removePendingNotifications) instead.

Cancels a local notification.

Parameters:

- `id` (Number | String): Application-created ID of the local notification to cancel. To create an ID for the notification, set the `id` property in the `userInfo` dictionary passed to the [Titanium.App.iOS.scheduleLocalNotification](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#scheduleLocalNotification) method.

### createSearchableIndex

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0

Creates and returns an instance of [Titanium.App.iOS.SearchableIndex](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableIndex.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.SearchableIndex>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.SearchableIndex](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableIndex.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.SearchableIndex

### createSearchableItem

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0

Creates and returns an instance of [Titanium.App.iOS.SearchableItem](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItem.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.SearchableItem>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.SearchableItem](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItem.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.SearchableItem

### createSearchableItemAttributeSet

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0

Creates and returns an instance of [Titanium.App.iOS.SearchableItemAttributeSet](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItemAttributeSet.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.SearchableItemAttributeSet>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.SearchableItemAttributeSet](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchableItemAttributeSet.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.SearchableItemAttributeSet

### createSearchQuery

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.5.0

Creates and returns an instance of [Titanium.App.iOS.SearchQuery](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchQuery.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.SearchQuery>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.SearchQuery](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SearchQuery.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.SearchQuery

### createUserActivity

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0

Creates and returns an instance of [Titanium.App.iOS.UserActivity](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserActivity.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.UserActivity>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.UserActivity](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserActivity.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.UserActivity

### createUserDefaults

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 4.0.0

Creates and returns an instance of Titanium.App.iOS.UserDefaults.

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.UserDefaults>): Properties to set on a new object, including any defined by Titanium.App.iOS.UserDefaults except those marked not-creation or read-only.

Returns: Titanium.App.iOS.UserDefaults

### createUserNotificationAction

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0

Creates and returns an instance of [Titanium.App.iOS.UserNotificationAction](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.UserNotificationAction>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.UserNotificationAction](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationAction.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.UserNotificationAction

### createUserNotificationCategory

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0

Creates and returns an instance of [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md).

Parameters:

- `parameters` (Dictionary<Titanium.App.iOS.UserNotificationCategory>, optional): Properties to set on a new object, including any defined by [Titanium.App.iOS.UserNotificationCategory](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md) except those marked not-creation or read-only.

Returns: Titanium.App.iOS.UserNotificationCategory

### endBackgroundHandler

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Marks the end of the app execution after initiating the download operation. Available only on iOS 7 and later.

When calling this method, pass in the `handlerID` value that initiated the background state.
You must call this handler after initiating the download operation and should do so as soon as possible.

Parameters:

- `handlerID` (String): Unique string identifier for the event (`backgroundfetch`, `silentpush` or `backgroundtransfer`) that initiated the background operation mode.

### registerBackgroundService

- Platforms: iPhone, iPad, macOS

Registers a service to run when the application is placed in the background.

Parameters:

- `params` (Dictionary): Parameters used to create the service. Must include a `url` property, to specify the local JavaScript file to execute when the application is placed in the background.

Returns: Titanium.App.iOS.BackgroundService

### registerUserNotificationSettings

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0

Registers the application to use the requested notification types and categories.

Call this method at application start up. If the application needs to register for remote
notifications, call this method before calling
[Titanium.Network.registerForPushNotifications](https://titaniumsdk.com/docs/sdk/Titanium.Network.md#registerForPushNotifications).

Parameters:

- `params` (UserNotificationSettings): Parameters used to enroll the application in local notifications.

### scheduleLocalNotification

- Platforms: iPhone, iPad, macOS

Schedule a local notification.

Parameters:

- `params` (NotificationParams): Parameters used to create a notification.

Returns: Titanium.App.iOS.LocalNotification

### sendWatchExtensionReply

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 4.1.0
- Requires: iOS 8.2+
- DEPRECATED since 5.0.0. Use [Titanium.WatchSession](Titanium.WatchSession) instead, which is supported on iOS 9 and later.

Marks the end of an `openParentApplication:reply` execution by a WatchKit extension.

This method must be called after your Titanium application has finished processing the `watchkitextensionrequest` event. Optional
information can be provided in the userInfo argument will be provided back to the WatchKit extension as part of the reply method.
If no userInfo is provide nil will be sent to the WatchKit extension to during the reply callback.

This method should be used as part of the `watchkitextensionrequest` event as shown below.

``` js
Ti.App.iOS.addEventListener("watchkitextensionrequest", function(e) {
    var replyContent = {foo: "bar"};
    Ti.App.iOS.sendWatchExtensionReply(e.handlerId,replyContent);
});
```

Parameters:

- `handlerId` (String): Unique string identifier for the event (`watchkitextensionrequest`) that initiated from the WatchKit extension calling the openParentApplication:reply method.
- `userInfo` (Dictionary): Custom data object which will be passed in the reply method to your WatchKit extension.

### setMinimumBackgroundFetchInterval

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Specifies the minimum amount of time that must elapse between background fetch operations.
Available only on iOS 7 and later.

This property has no effect for apps that do not have the UIBackgroundModes key with
the fetch value in its Info.plist file. The default fetch interval for apps is
[Titanium.App.iOS.BACKGROUNDFETCHINTERVAL_NEVER](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#BACKGROUNDFETCHINTERVAL_NEVER). Therefore, you must call this
method and set a fetch interval before your app is given background execution time.

Parameters:

- `fetchInterval` (Number): The minimum number of seconds that must elapse before another background fetch can be initiated. This value is advisory only and does not indicate the exact amount of time expected between fetch operations.

## Events

### backgroundfetch

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Fired when the application is woken up for a fetch operation. Available only on iOS 7 and later.

Add this event if your app supports the `fetch` UIBackground mode. When an opportunity arises to
download data, the system fires this event to give your app a chance to download any data it needs.
Your callback of this event should download the data, prepare that data for use, and call the
[endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method with the `handlerID` parameter from this event.

When this event is fired, your app has up to 30 seconds of wall-clock time to perform the download
operation and call the `endBackgroundHandler` method. In practice,
your app should call the `endBackgroundHandler` method as soon as possible
after initiating the download. If you do not call the `endBackgroundHandler` method in time, your app is suspended.
More importantly, the system uses the elapsed time to calculate power usage and data costs for your
app's background downloads. If your app takes a long time to call `endBackgroundHandler` method, it may be given fewer
future opportunities to fetch data in the future.

If you are downloading large content, initiate the download using a
[urlSession](Modules.URLSession) background download task, then call the `endBackgroundHandler` method.
Listen for the [downloadcompleted](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#downloadcompleted) event to prepare the data for use.

The event returns the dictionary containing the `handlerID` property, which is a unique handler ID for the
current event. This identifier should be passed as the argument to the
[endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method.

Event properties:

- `handlerId` (String): Unique string identifier for the `backgroundfetch` event. This identifier should be passed as the argument to the [endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method.

### backgroundtransfer

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired when the events related to a [urlSession](Modules.URLSession) are waiting to be processed.
Available only on iOS 7 and later.

The app fires this events when all background transfers associated with a `urlSession` object
have finished or failed. Use this method to reconnect any `urlSession`s and to update your
app's user interface. For example, you might use this method to update progress indicators
or to incorporate new content into your views. After processing the events, call the
[endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method with the `handlerID`
parameter. If a `urlSession` finishes its work when your app is not running, the system
launches your app in the background so that it can process the event. In that situation,
use the provided identifier to create a new `urlSessionConfiguration` and `urlSession` objects.
Upon creating urlSession object, that object calls the appropriate delegate methods to
process the events.

If your app already has a session object with the specified identifier and is running or suspended,
you do not need to create a new session object using this method. Suspended apps are moved into the
background. As soon as the app is running again, the `urlSession` object with the identifier receives
the events and processes them normally.

At launch time, the app does not call this method if there are uploads or downloads in progress.
If you want to display the current progress of those transfers in your app's user
interface, you must recreate the session object yourself. In that situation, cache the session
identifier value persistently and use it to recreate your session object.

Event properties:

- `handlerId` (String): Unique string identifier for the `backgroundtransfer` event. This identifier should be passed as the argument to the [endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method.
- `sessionId` (String): The identifier of the URL session requiring attention. If your app was just launched, you can use this identifier to create a new `urlSession` object that can receive the events.

### continueactivity

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 5.0.0
- Requires: iOS 8.2+

Fired when iOS continueactivity calls `continueUserActivity`.

Add this event if your Titanium application if you are responding to an iOS Handoff or Core Spotlight `continueUserActivity` request. This event will
fire when a user taps on the handoff icon or the Core Spotlight search item. Your Titanium application will be opened in the background and provides
your Titanium app the information from the NSUserActivity. When this event is fired you should implement logic within your application to allow the
user to pick-up from where they left off on their other device.

``` js
Ti.App.iOS.addEventListener("continueactivity", function(e) {
    console.log('activityType: '' + e.activityType);
});
```

Event properties:

- `activityType` (String): Unique string identifier for the handoff user activity. The identifier must be defined in your `tiapp.xml` file.
- `searchableItemActivityIdentifier` (String): With field will contain the searchable Unique Identifier if the continueactivity is fired from a Core Spotlight search result.
- `title` (String): The optional title provided to the user activity or search item.
- `webpageURL` (String): The optional webpageURL provided to the user activity.
- `userInfo` (Dictionary): The optional userInfo provided to the user activity. The userInfo is a custom dictionary and can contain any information needed to create your handoff or Core Spotlight session.

### downloadcompleted

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired to indicate that a [urlSession's](Modules.URLSession) download task has finished downloading.
Available only on iOS 7 and later.

This event only needs to be used if your app is using the `urlSession` module to download data.

Event properties:

- `taskIdentifier` (Number): The `urlSession` download task's identifier.
- `sessionIdentifier` (String): The `urlSession` session identifier. If it does not exist, this property is not provided. This property is available since Titanium Mobile 5.4.0.GA.
- `data` (Titanium.Blob): The downloaded data as a Titanium.Blob object.

### downloadprogress

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired periodically to inform the app about the download's progress of a [urlSession](Modules.URLSession).
Available only on iOS 7 and later.

This event only needs to be used if your app is using the `urlSession` module to download data.

Event properties:

- `taskIdentifier` (Number): The `urlSession` download task's identifier.
- `sessionIdentifier` (String): The `urlSession` session identifier. If it does not exist, this property is not provided. This property is available since Titanium Mobile 5.4.0.GA.
- `bytesWritten` (Number): The number of bytes transferred since the last time this event was fired.
- `totalBytesWritten` (Number): The total number of bytes transferred so far.
- `totalBytesExpectedToWrite` (Number): The expected length of the file, as provided by the Content-Length header. If this header was not provided, the value is zero.

### handleurl

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

Fired when a new URL is handled by the application.

Incoming URL's can either be triggered by an external application or
links inside your [Titanium.UI.WebView](https://titaniumsdk.com/docs/sdk/Titanium.UI.WebView.md) / <Modules.SafariDialog>.

Event properties:

- `launchOptions` (LaunchOptionsType): The launch options that are related to opening the URL.

### localnotificationaction

- Platforms: iPhone, iPad, macOS

Fired when a user selects an action for an interactive local notification.

Event properties:

- `alertAction` (String): Alert button text ('Open', by default) or slider text ('slide to unlock...', by default).
- `alertBody` (String): Alert message.
- `alertLaunchImage` (String): Image displayed instead of `Default.png` when launching the application.
- `badge` (Number): Application badge value.
- `date` (Date): Date and time when the notification was configured to fire.
- `identifier` (String): Identifier of the action that was selected of the interactive notification.
- `sound` (String): Path to the sound file configured to play when the notification was fired.
- `timezone` (String): Timezone of the date when the notification was configured to fire.
- `typedText` (String): User input if the notification used the `USER_NOTIFICATION_BEHAVIOR_TEXTINPUT` behavior.
- `userInfo` (Dictionary): Custom data object.
- `inBackground` (Boolean): Boolean indicating if notification was received while app was in background (since Titanium SDK 6.2.0). On iOS 10+ this is no longer available since the event will only fire when opening the app after interacting with a notification from the iOS notification center (which means the app was in background when the notification was received).
- `threadIdentifier` (String): The unique identifier for the thread or conversation related to this notification request. It will be used to visually group notifications together. Available in Titanium SDK 7.5.0+ and iOS 10+.
- `category` (String): The identifier of the app-defined [category object](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md). Available in Titanium SDK 7.5.0+ and iOS 10+.

### notification

- Platforms: iPhone, iPad, macOS

Fired when a local notification is received by the application.

Event properties:

- `alertAction` (String): Alert button text ('View', by default) or slider text ('slide to unlock...', by default).
- `alertBody` (String): Alert message.
- `alertLaunchImage` (String): Image displayed instead of `Default.png` when launching the application.
- `badge` (Number): Application badge value.
- `date` (Date): Date and time when the notification was configured to fire.
- `sound` (String): Name of the sound file configured to play when the notification was fired.
- `timezone` (String): Timezone of the date when the notification was configured to fire. Available in Titanium SDK 7.4.0+.
- `userInfo` (Dictionary): Custom data object.
- `inBackground` (Boolean): Boolean indicating if notification was received while app was in background. Available in Titanium SDK 6.2.0. On iOS 10+ this is no longer available since this event will only fire if the app is in foreground.
- `threadIdentifier` (String): The unique identifier for the thread or conversation related to this notification request. It will be used to visually group notifications together. Available in Titanium SDK 7.5.0+ and iOS 10+.
- `category` (String): The identifier of the app-defined [category object](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.UserNotificationCategory.md). Available in Titanium SDK 7.5.0+ and iOS 10+.

### remotenotificationaction

- Platforms: iPhone, iPad, macOS

Fired when a user selects an action for an interactive remote notification.

Event properties:

- `data` (Dictionary): The payload passed to the Apple Push Notification Service.
- `category` (String): Identifier of the category of the interactive notification.
- `identifier` (String): Identifier of the action that was selected of the interactive notification.

### screenshotcaptured

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 9.1.0
- DEPRECATED since 13.1.0. Use [Titanium.App.screenshotcaptured](Titanium.App.screenshotcaptured) instead.

Fired after the user takes a screenshot, e.g. by pressing both the home and lock screen buttons.

### sessioncompleted

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired to indicate that a [urlSession](Modules.URLSession) task finished transferring data.
Available only on iOS 7 and later.

This event only needs to be used if your app is using the `urlSession` module to download or upload data.

Server errors are not reported through the error parameter. The only error events sent
through the error parameter are client-side errors, such as being unable to resolve
the hostname or connect to the host.

Event properties:

- `taskIdentifier` (Number): The `urlSession` download task's identifier.
- `sessionIdentifier` (String): The `urlSession` session identifier. If it does not exist, this property is not provided. This property is available since Titanium Mobile 5.4.0.GA.
- `success` (Boolean): Indicates if the operation succeeded. Returns true if download succeeded, false otherwise.
- `errorCode` (Number): The error code of the error, if any (potentially system-dependent).
- `message` (String): A string containing the localized description of the error. This property does not exist if errorCode is 0, which means there is no error.
- `responseText` (String): The response text for [task](Modules.URLSession.task) and [uploadTask](Modules.URLSession.uploadTask). This property does not exist for download task. For download task response, use [downloadcompleted](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#downloadcompleted) event.
- `statusCode` (Number): The response status code for tasks.

### sessioneventscompleted

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired to indicate that all messages enqueued for a [urlSession](Modules.URLSession) have been delivered.
Available only on iOS 7 and later.

This event only needs to be used if your app is using the `urlSession` module to download data.

In iOS, when a background transfer completes and if your app is no longer running, your app
is automatically relaunched in the background, and the app fires the [backgroundtransfer](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#backgroundtransfer) event.
This event should contain the identifier of the session that caused your app to be launched.
Your app should then store that `handlerID` before creating a background session configuration object
with the same identifier, and creating a URL session object with that configuration.
The newly created session is automatically reassociated with ongoing background activity.

When your app later receives a `sessioneventscompleted` event, this indicates that
all messages previously enqueued for this session have been delivered, and that it
is now safe to invoke [endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler)
method with the `handlerID` or to begin any internal updates that may result in invoking
this method.

Event properties:

- `sessionIdentifier` (String): The `urlSession` session identifier. If it does not exist, this property is not provided. This property is available since Titanium Mobile 5.4.0.GA.

### shortcutitemclick

- Platforms: iPhone
- Since: Titanium SDK 5.1.0

Fired when a user taps the Application Shortcut.

Event properties:

- `itemtype` (String): The unique identifier for the application shortcut.
- `title` (String): The title of the application shortcut.
- `subtitle` (String): The subtitle of the application shortcut.
- `userInfo` (Dictionary): The payload passed by the application shortcut.

### silentpush

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired when the application is woken up by a silent remote notification. Available only on iOS 7 and later.

Add this event if your app supports the `remote-notification` UIBackground mode.
This event is intended as a means for apps to minimize the time that elapses between
the user seeing a push notification and the app displaying the associated data.
When a push notification arrives, the system displays the notification to the user and
launches the app in the background (if needed) so that it can call this event.
Use this event to download any data related to the push notification. When your method
is done, call the [endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method with
`handlerID` parameter from this event.

The system fires this event regardless of the state of your app. If your app is suspended
or not running, the system wakes up or launches your app and puts it into the background
running state before firing the event.

When this event is fired, your app has up to 30 seconds of wall-clock time to perform the download
operation and call the `endBackgroundHandler` method. In practice,
your app should call the `endBackgroundHandler` method as soon as possible
after initiating the download. If you do not call the `endBackgroundHandler` method in time, your app is suspended.
More importantly, the system uses the elapsed time to calculate power usage and data costs for your
app's background downloads. If your app takes a long time to call `endBackgroundHandler` method, it may be given fewer
future opportunities to fetch data in the future.

If you are downloading large content, initiate the download using a
[urlSession](Modules.URLSession) background download task, then call the `endBackgroundHandler` method.
Listen for the [downloadcompleted](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#downloadcompleted) event to prepare the data for use.

The event returns the dictionary containing the `handlerID` property, which is a unique handler ID for the
current event. This identifier should be passed as the argument to the
[endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method.

You can send extra information with a silent push using extra:

``` js
{
  aps: {
    'content-available': 1
  },
  extra: {
    foo: 'bar'
  }
}
```

In the event handler for <code>silentpush</code>, your code may look something like this:
``` json
{
  "handlerId": "SilentPush-1415976886.375816",
  "aps": {
    "content-available": 1,
  },
  "extra": {
    "foo": "bar"
  },
  "bubbles": true,
  "type": "silentpush",
  "source": {},
  "cancelBubble": false
}
```

Event properties:

- `handlerId` (String): Unique string identifier for the `silentpush` event. This identifier should be passed as the argument to the [endBackgroundHandler](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#endBackgroundHandler) method.

### traitcollectionchange

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 8.2.0

Fired when the trait collection of the device changes, e.g. the user interface style.

### uploadprogress

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.2.0

Fired periodically to inform the app about the upload's progress of a [urlSession](Modules.URLSession).
Available only on iOS 7 and later.

This event only needs to be used if your app is using the `urlSession` module to upload data.

Event properties:

- `taskIdentifier` (Number): The `urlSession` upload task's identifier.
- `sessionIdentifier` (String): The `urlSession` session identifier. If it does not exist, this property is not provided. This property is available since Titanium Mobile 5.4.0.GA.
- `bytesSent` (Number): The number of bytes transferred since the last time this event was fired.
- `totalBytesSent` (Number): The total number of bytes transferred so far.
- `totalBytesExpectedToSend` (Number): The expected length of the file, as provided by the Content-Length header. If this header was not provided, the value is zero.

### usernotificationsettings

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 3.4.0

Fired when the user notification settings are registered.

Event properties:

- `types` (Array<Number>): Notification types the application is registered to use.
- `categories` (Array<Titanium.App.iOS.UserNotificationCategory>): Set of categories of user notification actions the application is registered to use.

### watchkitextensionrequest

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 4.1.0
- Requires: iOS 8.2+
- DEPRECATED since 5.0.0. Use [Titanium.WatchSession](Titanium.WatchSession) instead, which is supported on iOS 9 and later.

Fired when openParentApplication:reply is called from a WatchKit extension. Available only on iOS 8.2 and later.

Add this event if your Titanium application if you are using a WatchKit extension. When your WatchKit extension uses the openParentApplication:reply
method your Titanium application will be opened in the background and provides your Titanium app the information from the extension. When this
event is fired you must provide a reply by calling the [sendWatchExtensionReply](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#sendWatchExtensionReply) method with
the `handlerID` parameter from this event.

The event returns the dictionary containing the `handlerID` property, which is a unique handler ID for the
current event and the `userInfo` property, containing the dictionary passed from the WatchKit extension. The `handlerID` identifier
must be passed as the an argument to the [sendWatchExtensionReply](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#sendWatchExtensionReply) method.

``` js
Ti.App.iOS.addEventListener("watchkitextensionrequest",function(e){
    var replyContent = {foo:"bar"};
    Ti.App.iOS.sendWatchExtensionReply(e.handlerId,replyContent);
});
```

Event properties:

- `handlerId` (String): Unique string identifier for the `watchkitextensionrequest` event. This identifier should be passed an argument to the [sendWatchExtensionReply](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#sendWatchExtensionReply) method.
- `userInfo` (Dictionary): The payload passed to the `openParentApplication:reply` method from the WatchKit extension.

## Inherited members

6 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/13.4.0/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

