<commit_before><h1 align="center">
  <a href="https://branch.io"><img src="http://i.imgur.com/Y5EPQTo.png" alt="Branch for Cordova/PhoneGap/Ionic" width="550"></a>
</h1>
<p align="center">
  <a href="https://travis-ci.org/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking"><img src="https://img.shields.io/travis/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/master.svg" alt="Travis"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/dt/branch-cordova-sdk.svg" alt="npm downloads"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/v/branch-cordova-sdk.svg" alt="npm version"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/l/branch-cordova-sdk.svg" alt="npm version"></a>
</p>

> Hyperlinks can navigate to your website, but not to your app. Branch fixes this with deep links.

> Branch will grow your app by allowing users to install, open, and navigate to content inside your app.

> Increase discovery of your app by sharing its content, converting web users to app users, enabling user-to-user sharing, personalizing user experiences, tracking users, tracking referrals, tracking campaigns, tracking conversions, and increasing overall engagement.

<p align="center">
  <a href="https://youtu.be/MXgLQ8QDXk8"><img src="http://i.imgur.com/NF2NEDn.gif"/></a>
</p>

# Branch for Cordova, PhoneGap, and Ionic
*Questions? [Contact us](https://support.branch.io/support/tickets/new)*

- [Getting Started](#getting-started)
  - [Configure Branch](#configure-branch)
  - [Configure App](#configure-app)
  - [Initialize Branch](#initialize-branch)
  - [Test Deep Link iOS](#test-deep-link-ios)
  - [Test Deep Link Android](#test-deep-link-android)
- [Features](#features)
  - [Initialize Branch Features](#initialize-branch-features)
  - [Create Content Reference](#create-content-reference)
  - [Create Deep Link](#create-deep-link)
  - [Share Deep Link](#share-deep-link)
  - [Read Deep Link](#read-deep-link)
  - [Display Content](#display-content)
  - [Track Content](#track-content)
  - [Track User](#track-user)
  - [Track Event](#track-event)
  - [Handle Referrals](#handle-referrals)
- [Troubleshooting](#troubleshooting)
  - [Testing: Optional App Config](#testing-optional-app-config)
  - [Testing: Branch Analytics](#testing-branch-analytics)
  - [Testing: Simulating an Install](#testing-simulating-an-install)
  - [Testing: Supported Platforms](#testing-supported-platforms)  
  - [Testing: Sample Test App](#testing-sample-test-app)
  - [Link Data: Universal Object Properties](#link-data-universal-object-properties)
  - [Link Data: Deep Link Properties](#link-data-deep-link-properties)
  - [Compiling: Cordova Dependencies](#compiling-cordova-dependencies)
  - [Compiling: Show Console Logs](#compiling-show-console-logs)
  - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins)
  - [Compiling: Errors](#compiling-errors)
- [Additional](#additional)
  - [SDK Development](#sdk-development)
  - [Bulk Link Creation](#bulk-link-creation)
  - [Analytical Data](#analytical-data)
  - [Webpage Features](#webpage-features)
  - [Premium Features](#premium-feature)

## Getting Started

- #### Configure Branch

  - Complete your [Branch Dashboard](https://dashboard.branch.io/settings/link)

    ![image](http://i.imgur.com/wazVu3U.png)
    ![image](http://i.imgur.com/9PEylbS.png)

- #### Configure App

  - Cordova and Ionic
    ```xml
    <!-- sample config.xml -->
    <widget id="com.eneff.branch.cordovatestbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
      <!-- Branch -->
      <plugin name="branch-cordova-sdk" spec="^2.5.0" />
      <branch-config>
        <branch-key value="<KEY>" />
        <uri-scheme value="branchcordova" />
        <link-domain value="cordova.app.link" />
        <ios-team-release value="PW4Q8885U7" />
      </branch-config>
    ```

  - PhoneGap
    ```xml
    <!-- sample config.xml -->
    <widget id="com.eneff.branch.cordovatestbed" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
      <!-- Branch -->
      <plugin name="branch-cordova-sdk" spec="^2.5.0" />
      <branch-config>
        <branch-key value="<KEY>" />
        <uri-scheme value="branchcordova" />
        <link-domain value="cordova.app.link" />
        <ios-team-release value="PW4Q8885U7" />
      </branch-config>
    ```

  - Change the following values to match your [Branch Dashboard](https://dashboard.branch.io/settings/link)
    - `com.eneff.branch.cordovatestbed`
    - `branchcordova`
    - `PW4Q8885U7`
    - `cordova.app.link`

- #### Initialize Branch

  - Cordova and PhoneGap
    ```js
    // sample index.js
    var app = {
      initialize: function() {
        this.bindEvents();<commit_msg>docs: added replace for config.xml<commit_after><h1 align="center">
  <a href="https://branch.io"><img src="http://i.imgur.com/Y5EPQTo.png" alt="Branch for Cordova/PhoneGap/Ionic" width="550"></a>
</h1>
<p align="center">
  <a href="https://travis-ci.org/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking"><img src="https://img.shields.io/travis/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/master.svg" alt="Travis"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/dt/branch-cordova-sdk.svg" alt="npm downloads"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/v/branch-cordova-sdk.svg" alt="npm version"></a>
  <a href="https://www.npmjs.com/package/branch-cordova-sdk"><img src="https://img.shields.io/npm/l/branch-cordova-sdk.svg" alt="npm version"></a>
</p>

> Hyperlinks can navigate to your website, but not to your app. Branch fixes this with deep links.

> Branch will grow your app by allowing users to install, open, and navigate to content inside your app.

> Increase discovery of your app by sharing its content, converting web users to app users, enabling user-to-user sharing, personalizing user experiences, tracking users, tracking referrals, tracking campaigns, tracking conversions, and increasing overall engagement.

<p align="center">
  <a href="https://youtu.be/MXgLQ8QDXk8"><img src="http://i.imgur.com/NF2NEDn.gif"/></a>
</p>

# Branch for Cordova, PhoneGap, and Ionic
*Questions? [Contact us](https://support.branch.io/support/tickets/new)*

- [Getting Started](#getting-started)
  - [Configure Branch](#configure-branch)
  - [Configure App](#configure-app)
  - [Initialize Branch](#initialize-branch)
  - [Test Deep Link iOS](#test-deep-link-ios)
  - [Test Deep Link Android](#test-deep-link-android)
- [Features](#features)
  - [Initialize Branch Features](#initialize-branch-features)
  - [Create Content Reference](#create-content-reference)
  - [Create Deep Link](#create-deep-link)
  - [Share Deep Link](#share-deep-link)
  - [Read Deep Link](#read-deep-link)
  - [Display Content](#display-content)
  - [Track Content](#track-content)
  - [Track User](#track-user)
  - [Track Event](#track-event)
  - [Handle Referrals](#handle-referrals)
- [Troubleshooting](#troubleshooting)
  - [Testing: Optional App Config](#testing-optional-app-config)
  - [Testing: Branch Analytics](#testing-branch-analytics)
  - [Testing: Simulating an Install](#testing-simulating-an-install)
  - [Testing: Supported Platforms](#testing-supported-platforms)  
  - [Testing: Sample Test App](#testing-sample-test-app)
  - [Link Data: Universal Object Properties](#link-data-universal-object-properties)
  - [Link Data: Deep Link Properties](#link-data-deep-link-properties)
  - [Compiling: Cordova Dependencies](#compiling-cordova-dependencies)
  - [Compiling: Show Console Logs](#compiling-show-console-logs)
  - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins)
  - [Compiling: Errors](#compiling-errors)
- [Additional](#additional)
  - [SDK Development](#sdk-development)
  - [Bulk Link Creation](#bulk-link-creation)
  - [Analytical Data](#analytical-data)
  - [Webpage Features](#webpage-features)
  - [Premium Features](#premium-feature)

## Getting Started

- #### Configure Branch

  - Complete your [Branch Dashboard](https://dashboard.branch.io/settings/link)

    ![image](http://i.imgur.com/wazVu3U.png)
    ![image](http://i.imgur.com/9PEylbS.png)

- #### Configure App

  - Cordova and Ionic
    ```xml
    <!-- sample config.xml -->
    <widget id="com.eneff.branch.cordovatestbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
      <!-- Branch -->
      <plugin name="branch-cordova-sdk" spec="^2.5.0" />
      <branch-config>
        <branch-key value="<KEY>" />
        <uri-scheme value="branchcordova" />
        <link-domain value="cordova.app.link" />
        <ios-team-release value="PW4Q8885U7" />
      </branch-config>
    ```

  - PhoneGap
    ```xml
    <!-- sample config.xml -->
    <widget id="com.eneff.branch.cordovatestbed" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
      <!-- Branch -->
      <plugin name="branch-cordova-sdk" spec="^2.5.0" />
      <branch-config>
        <branch-key value="<KEY>" />
        <uri-scheme value="branchcordova" />
        <link-domain value="cordova.app.link" />
        <ios-team-release value="PW4Q8885U7" />
      </branch-config>
    ```

  - Change the following values to match your [Branch Dashboard](https://dashboard.branch.io/settings/link)
    - `com.eneff.branch.cordovatestbed`
    - `key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3`
    - `branchcordova`
    - `cordova.app.link`
    - `PW4Q8885U7`

- #### Initialize Branch

  - Cordova and PhoneGap
    ```js
    // sample index.js
    var app = {
      initialize: function() {
        this.bindEvents();
{'fraction_non_alphanumeric': 0.17704025017653585, 'fraction_numerical': 0.00998688590739433, 'mean_word_length': 3.8102862688015526, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 101, 'https://': 26, 'lorem ipsum': 0, 'www.': 10, 'xml': 17}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5228193', 'n_tokens_mistral': 3465, 'n_tokens_neox': 3272, 'n_words': 596}