<commit_before>---
name: Titanium.App.iOS
summary: |
    The top-level App iOS module, available only to iOS devices, that includes the facilities to 
    create and manage local notifications and background services.
description: |
    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, an alert dialog is displayed 
    containing a "Close" button to dismiss and a customizable "View" button to bring the application 
    into the foreground. Also, they can be configured to set an application icon badge, to show the 
    number of pending notifications, and to generate a sound.

extends: Titanium.Module
platforms: [iphone, ipad]
since: "1.5"

methods:
  - name: cancelAllLocalNotifications
    summary: Cancels all scheduled local notifications.

  - name: cancelLocalNotification
    summary: Cancels a local notification.
    parameters:
      - name: id
        summary: ID of the local notification to cancel.
        type: Number

  - name: registerBackgroundService
    summary: Registers a service to run when the application is placed in the background.
    returns:
        type: Titanium.App.iOS.BackgroundService
    parameters:
      - name: params
        summary: |
            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.
        type: Dictionary

  - name: createUserNotificationAction
    summary: Creates notification action
    description:  |
            In iOS 8, notification actions can be created and configured, such that when notifications are received
            when app is in the background: lock screen or home screen, actions can be executed based on the configuration

                var acceptAction = Ti.App.iOS.createUserNotificationAction({
                    identifier: "ACCEPT_IDENTIFIER",
                    title: "Accept",
                    activationMode: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_BACKGROUND,
                    destructive: false,
                    authenticationRequired: false
                }) ;
    parameters: 
      - name: identifier
        summary: the identifier for this action
        type: String
      - name: title
        summary: the title displayed on screen for this action
        type: String
      - name: activationMode
        summary: whether the action executes in the background or opens the app to execute in the foreground
        constants: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_*
        type: Number
      - name: destructive
        summary: if the action makes a change that is permanent like trash or delete
        type: Boolean
      - name: authenticationRequired
        summary: if the action requires the user to authenticate in lock screen
        type: Boolean
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: createUserNotificationCategory
    summary: Creates notification category
    description:  |
            Each notification can display more than one action. The category is used to contain the actions required for
            the notification to display. 

                var backgroundCategory = Ti.App.iOS.createUserNotificationCategory({
                identifier: "BACKGROUND_CATEGORY",
                actionsForDefaultContext: [acceptAction, maybeAction, declineAction],
                actionsForMinimalContext: [acceptAction, declineAction]
                });

    parameters: 
      - name: identifier
        summary: the identifier for this category
        type: String
      - name: actionsForDefaultContext
        summary: the default array of actions to display for notification. All actions are shown for Alert Style. 
        type: Array
      - name: actionsForMinimalContext
        summary: the array of actions to display for notification for Banner Style. If not specified selected first and last action on default context shown instead.
        type: Array
        optional: true
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: registerForLocalNotifications
    summary: Registers the app for local notifications
    description:  |
            Starting in iOS 8 the app _must_ ask the user for permission before using local notifications.
            This is done by registering the application to use local notifications, here you can specify
            the types of notifications the app will use, such as <Titanium.App.iOS.NOTIFICATION_TYPE_BADGE>,
            <Titanium.App.iOS.NOTIFICATION_TYPE_ALERT>, <Titanium.App.iOS.NOTIFICATION_TYPE_SOUND>, and/or
            <Titanium.App.iOS.NOTIFICATION_TYPE_NONE>

                Ti.App.iOS.registerForLocalNotifications({
                    types: Ti.App.iOS.NOTIFICATION_TYPE_BADGE |
                           Ti.App.iOS.NOTIFICATION_TYPE_SOUND |
                           Ti.App.iOS.NOTIFICATION_TYPE_ALERT,
                    categories: [backgroundCategory,backgroundLockCategory,foregroundCategory]
                });
                Ti.App.addEventListener('paused', function(){
                    Ti.App.iOS.scheduleLocalNotification({
                        alertBody: 'Hello!',
                        alertAction: 'Here!',
                        category: 'BACKGROUND_CATEGORY'
                    });
                });
    parameters: 
      - name: types
        summary: The types of notifications required by the application separated by a bitwise-OR operator
        constants: Titanium.App.iOS.NOTIFICATION_TYPE_*
        type: Number
      - name: categories
        summary: The set of categories of user notification actions required by local and remote notifications
        type: Array
        optional: true
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: scheduleLocalNotification
    summary: Schedule a local notification.
    returns:
        type: Titanium.App.iOS.LocalNotification
    parameters:
      - name: params
        summary: Parameters used to create a notification.
        type: Dictionary<NotificationParams>

  - name: setMinimumBackgroundFetchInterval
    summary: |
        Specifies the minimum amount of time that must elapse between background fetch operations.
        Available only on iOS 7 and later.
    description: |
        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>. Therefore, you must call this
        method and set a fetch interval before your app is given background execution time.
    parameters:
      - name: fetchInterval
        summary: |
            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.
        constants: Titanium.App.iOS.BACKGROUNDFETCHINTERVAL_*
        type: Number
    osver: {ios: {min: "7.0"}}
    since: "3.2.0"<commit_msg>[TIMOB-17238] Documention cleanup in interactive notifications<commit_after>---
name: Titanium.App.iOS
summary: |
    The top-level App iOS module, available only to iOS devices, that includes the facilities to 
    create and manage local notifications and background services.
description: |
    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, an alert dialog is displayed 
    containing a "Close" button to dismiss and a customizable "View" button to bring the application 
    into the foreground. Also, they can be configured to set an application icon badge, to show the 
    number of pending notifications, and to generate a sound.

extends: Titanium.Module
platforms: [iphone, ipad]
since: "1.5"

methods:
  - name: cancelAllLocalNotifications
    summary: Cancels all scheduled local notifications.

  - name: cancelLocalNotification
    summary: Cancels a local notification.
    parameters:
      - name: id
        summary: ID of the local notification to cancel.
        type: Number

  - name: registerBackgroundService
    summary: Registers a service to run when the application is placed in the background.
    returns:
        type: Titanium.App.iOS.BackgroundService
    parameters:
      - name: params
        summary: |
            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.
        type: Dictionary

  - name: createUserNotificationAction
    summary: Creates notification action
    description:  |
            In iOS 8, notification actions can be created and configured, such that when notifications are received
            when app is in the background: lock screen or home screen, actions can be executed based on the configuration

                var acceptAction = Ti.App.iOS.createUserNotificationAction({
                    identifier: "ACCEPT_IDENTIFIER",
                    title: "Accept",
                    activationMode: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_BACKGROUND,
                    destructive: false,
                    authenticationRequired: false
                });
    parameters:
      - name: params
        summary: |
            Dictionary with the following proeprties:

             * `identifier` (String): the identifier for this action
             * `title` (String): the title displayed on screen for this action
             * `activationMode` (Number): whether the action executes in the background or opens the app to execute in the foreground
               constants: Ti.App.iOS.NOTIFICATION_ACTIVATION_MODE_*
             * `destructive` (Boolean): if the action makes a change that is permanent like trash or delete
             * `authenticationRequired` (Boolean): if the action requires the user to authenticate in lock screen
        type: Dictionary
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: createUserNotificationCategory
    summary: Creates notification category
    description:  |
            Each notification can display more than one action. The category is used to contain the actions required for
            the notification to display. 

                var backgroundCategory = Ti.App.iOS.createUserNotificationCategory({
                    identifier: "BACKGROUND_CATEGORY",
                    actionsForDefaultContext: [acceptAction, maybeAction, declineAction],
                    actionsForMinimalContext: [acceptAction, declineAction]
                });

    parameters: 
      - name: params
        summary: |
            Dictionary with the following proeprties:

              * `identifier` (String): the identifier for this category
              * `actionsForDefaultContext` (Array): the default array of actions to display for notification. All actions are
                shown for Alert Style.
              * `actionsForMinimalContext` (Array): the array of actions to display for notification for Banner Style. If not
                specified selected first and last action on default context shown instead. This parameter is optional.
        type: Dictionary
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: registerForLocalNotifications
    summary: Registers the app for local notifications
    description:  |
            Starting in iOS 8 the app _must_ ask the user for permission before using local notifications.
            This is done by registering the application to use local notifications, here you can specify
            the types of notifications the app will use, such as <Titanium.App.iOS.NOTIFICATION_TYPE_BADGE>,
            <Titanium.App.iOS.NOTIFICATION_TYPE_ALERT>, <Titanium.App.iOS.NOTIFICATION_TYPE_SOUND>, and/or
            <Titanium.App.iOS.NOTIFICATION_TYPE_NONE>

                Ti.App.iOS.registerForLocalNotifications({
                    types: Ti.App.iOS.NOTIFICATION_TYPE_BADGE |
                           Ti.App.iOS.NOTIFICATION_TYPE_SOUND |
                           Ti.App.iOS.NOTIFICATION_TYPE_ALERT,
                    categories: [backgroundCategory,backgroundLockCategory,foregroundCategory]
                });
                Ti.App.addEventListener('paused', function(){
                    Ti.App.iOS.scheduleLocalNotification({
                        alertBody: 'Hello!',
                        alertAction: 'Here!',
                        category: 'BACKGROUND_CATEGORY'
                    });
                });
    parameters: 
      - name: params
        summary: |
          Dictionary with the following optional parameters
            * `types` (Number): The types of notifications required by the application separated by a bitwise-OR operator.
              Use the Titanium.App.iOS.NOTIFICATION_TYPE_* constants.
            * `categories` (Array): The set of [categories](Titanium.App.iOS.createUserNotificationCategory) of user notification actions required by local and remote notifications
        type: Dictionary
    since: 3.4.0
    osver: {ios: {min: "8.0"}}

  - name: scheduleLocalNotification
    summary: Schedule a local notification.
    returns:
        type: Titanium.App.iOS.LocalNotification
    parameters:
      - name: params
        summary: Parameters used to create a notification.
        type: Dictionary<NotificationParams>

  - name: setMinimumBackgroundFetchInterval
    summary: |
        Specifies the minimum amount of time that must elapse between background fetch operations.
        Available only on iOS 7 and later.
    description: |
        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>. Therefore, you must call this
        method and set a fetch interval before your app is given background execution time.
    parameters:
      - name: fetchInterval
        summary: |
            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.
        constants: Titanium.App.iOS.BACKGROUNDFETCHINTERVAL_*
        type: Number
    osver: {ios: {min: "7.0"}}
    since: "3.2.0"
{'fraction_non_alphanumeric': 0.056577957173154544, 'fraction_numerical': 0.003762742012724909, 'mean_word_length': 2.3963754646840147, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4016354', 'n_tokens_mistral': 3574, 'n_tokens_neox': 3361, 'n_words': 1413}