Skip to content

The Cordova SDK for deferred deep linking is a thin wrapper around our native iOS/Android SDKs. Branch helps mobile apps grow with deep links / deeplinks that power referral systems, sharing links and invites with full attribution and analytics.

License

Notifications You must be signed in to change notification settings

robertgacki/cordova-ionic-phonegap-branch-deep-linking

 
 

Repository files navigation

Branch for Cordova/PhoneGap/Ionic

Travis npm downloads npm version npm version

Branch for Cordova/PhoneGap/Ionic

Questions? Contact us

Integration

  • Configure Branch

  • Install Branch

    • Change key_live_hiuejxqEdbHR8Tc1L92nmiijrse9OBpq, and branchcordova to the values in your Branch Dashboard

    • Cordova and PhoneGap and Ionic ```sh # terminal cordova plugin remove io.branch.sdk; cordova plugin add branch-cordova-sdk --variable BRANCH_KEY=key_live_hiuejxqEdbHR8Tc1L92nmiijrse9OBpq --variable URI_SCHEME=branchcordova; ```
  • Configure App

    • Change com.eneff.branch.cordova, PW4Q8885U7, 2d0s.app.link, and 2d0s-alternate.app.link to the values in your Branch Dashboard

    • Cordova and Ionic ```xml ```
    • PhoneGap ```xml ```
  • Initialize Branch

    • Cordova and PhoneGap ```js // sample index.js var app = { initialize: function() { this.bindEvents(); },

      bindEvents: function() { document.addEventListener("deviceready", this.onDeviceReady, false); }, onDeviceReady: function() { BranchInit(true); },

      function BranchInit(isDebug) { Branch.setDebug(isDebug); // for development and debugging only Branch.initSession().then(function(res) { console.log(res); }).catch(function(err) { console.error(err); }); } };

      app.initialize();

      </details>
      
      
    • Ionic 1 ```js // sample app.js .run(function($ionicPlatform) { $ionicPlatform.ready(function() {
      $ionicPlatform.on("deviceready", function(){
        BranchInit(true);
      });
      
      function BranchInit(isDebug) {
        Branch.setDebug(isDebug); // for development and debugging only
        Branch.initSession().then(function(res) {
          console.log(res);
        }).catch(function(err) {
          console.error(err);
        });
      }
      

      }); })

      </details>
      
      
    • Ionic 2 ```typescript // sample app.component.js declare var Branch;

      @Component({ // ... })

      export class MyApp { constructor(platform: Platform) { platform.ready().then(() => {

        // Branch
        Branch.setDebug(isDebug); // for development and debugging only
        Branch.initSession().then(function(res) {
          console.log(res);
        }).catch(function(err) {
          console.error(err);
        });
      });
      

      } }

      </details>
      
      
  • Listen Deep Link

    • DeepLinkHandler must be a global function and does not have to be in index.html

    • Cordova and PhoneGap and Ionic ```html <script> // required function DeepLinkHandler(data) { if (data) { alert("Data Link handler response: " + JSON.stringify(data)); } }
        // optional
        function NonBranchLinkHandler(data) {
          if (data) {
            alert("Non-Branch Link Detected: " + JSON.stringify(data));
          }
        }
      </script>
      
      ```
  • Test Deep Link iOS

    • Wait 30 minutes after saving changes on the Branch Dashboard

    • Create a deep link from the Branch Marketing Dashboard

    • Delete your app from the device (reset the Apple AASA scraping)

    • Compile your app (cordova build ios phonegap build ios ionic build ios)

    • Launch your app to device from Xcode (not TestFlight or Simulator)

    • Paste deep link in Apple Notes

    • Long press on the deep link (not 3D Touch)

    • Click Open in "APP_NAME" to open app

    • Example ![image](http://i.imgur.com/VJVICXd.png)
  • Test Deep Link Android

    • Wait 30 minutes after saving changes on the Branch Dashboard

    • Create a deep link from the Branch Marketing Dashboard

    • Delete your app from the device

    • Compile your app (cordova build android phonegap build android ionic build android)

    • Launch your app to device

    • Paste deep link in Google Hangouts

    • Tap on the deep link to open app

Features

  • Initialize Branch Features

    • Load Branch into your app. Must be called on deviceReady

    • Example ```js // for development and debugging only Branch.setDebug(isDebug);

      // sync with Mixpanel if installed Branch.setMixpanelToken('your_mixpanel_token');

      // init Branch Branch.initSession().then(function(res) { console.log(res); }).catch(function(err) { console.error(err); });

      </details>
      
      
  • Create Content Reference

    • The Branch Universal Object encapsulates the thing you want to share (content or user)

    • Properties
      Key Default Usage Link Property
      canonicalIdentifier (Required) This is the unique identifier for content that will help Branch dedupe across many instances of the same thing. Suitable options: a website with pathing, or a database with identifiers for entities $canonical_identifier
      canonicalUrl The canonical URL, used for SEO purposes $canonical_url
      title The name for the piece of content $og_title
      contentDescription A description for the content $og_description
      contentImageUrl The image URL for the content $og_image_url
      price The price of the item $amount
      currency The currency representing the price in ISO 4217 currency code $currency
      contentIndexMode "public" Can be set to either "public" or "private". Public indicates that you’d like this content to be discovered by other apps. $publicly_indexable
      contentMetadata Any custom key-value data e.g. { "custom": "data" }
    • Example ```js // only canonicalIdentifier is required var properties = { canonicalIdentifier: "123", canonicalUrl: "http://example.com/123", title: "Content 123", contentDescription: "Content 123 " + Date.now(), contentImageUrl: "http://lorempixel.com/400/400", price: 12.12, currency: "GBD", contentIndexingMode: "private", contentMetadata: { "custom": "data", "testing": 123, "this_is": true } };

      // create a branchUniversalObj variable to reference with other Branch methods var branchUniversalObj = null; Branch.createBranchUniversalObject(properties).then(function(res) { branchUniversalObj = res; alert("Response: " + JSON.stringify(res)); }).catch(function(err) { alert("Error: " + JSON.stringify(err)); });

      </details>
      
      
  • Create Deep Link

    • Creates a deep link URL with encapsulated data

    • Needs a Branch Universal Object

    • Analytics
      Key Default Usage
      channel Use channel to tag the route that your link reaches users. For example, tag links with "Facebook" or "LinkedIn" to help track clicks and installs through those paths separately
      feature This is the feature of your app that the link might be associated with. For example, if you had built a referral program, you would label links with the feature ‘referral’
      campaign Use this field to organize the links by actual campaign. For example, if you launched a new feature or product and want to run a campaign around that
      stage Use this to categorize the progress or category of a user when the link was generated. For example, if you had an invite system accessible on level 1, level 3 and 5, you could differentiate links generated at each level with this parameter
      tags This is a free form entry with unlimited values ["string"]. Use it to organize your link data with labels that don’t fit within the bounds of the above
      alias Specify a link alias in place of the standard encoded short URL e.g. yourdomain.com/youralias. Link aliases are unique, immutable objects that cannot be deleted. Aliases on the legacy bnc.lt domain are incompatible with Universal Links and Spotlight
      type 0 Set to 1 to limit deep linking behavior of the generated link to a single use. Set type to 2 to make link show up under Marketing Dashboard
    • Properties
      • Custom Data
        Key Value Usage
        random 123 Any key-value pair
        hello "world" Any key-value pair
        custom_data true Any key-value pair
      • Redirection
        Key Default Usage
        $fallback_url Change the redirect endpoint for all platforms - so you don’t have to enable it by platform. Note that Branch will forward all robots to this URL, overriding any OG tags entered in the link. System-wide Default URL (set in Link Settings)
        $desktop_url Change the redirect endpoint on desktops Text-Me-The-App page (set in Link Settings)
        $ios_url Change the redirect endpoint for iOS App Store page for your app (set in Link Settings)
        $ipad_url Change the redirect endpoint for iPads $ios_url value
        $android_url Change the redirect endpoint for Android Play Store page for your app (set in Link Settings)
        $windows_phone_url Change the redirect endpoint for Windows OS Windows Phone default URL (set in Link Settings)
        $blackberry_url Change the redirect endpoint for Blackberry OS BlackBerry default URL (set in Link Settings)
        $fire_url Change the redirect endpoint for Amazon Fire OS Fire default URL (set in Link Settings)
        $ios_wechat_url Change the redirect endpoint for WeChat on iOS devices $ios_url value
        $android_wechat_url Change the redirect endpoint for WeChat on Android devices $android_url value
        $after_click_url URL redirect to after the main click redirect has completed
        $web_only false Force to open the $fallback_url instead of the app
      • Deep Link
        Key Default Usage
        $deeplink_path open?link_click_id=1234 Set the deep link path for all platforms - so you don’t have to enable it by platform. When the Branch SDK receives a link with this parameter set, it will automatically load the custom URI path contained within
        $android_deeplink_path Set the deep link path for Android apps When the Branch SDK receives a link with this parameter set, it will automatically load the custom URI path contained within
        $ios_deeplink_path Set the deep link path for iOS apps. When the Branch SDK receives a link with this parameter set, it will automatically load the custom URI path contained within
        $match_duration 7200 Lets you control the fingerprinting match timeout (the time that a click will wait for an app open to match) also known as attribution window. Specified in seconds
        $always_deeplink true Set to false to make links always fall back to your mobile site. Does not apply to Universal Links or Android App Links.
        $ios_redirect_timeout 750 Control the timeout that the client-side JS waits after trying to open up the app before redirecting to the App Store. Specified in milliseconds
        $android_redirect_timeout 750 Control the timeout that the clientside JS waits after trying to open up the app before redirecting to the Play Store. Specified in milliseconds
        $one_time_use false Set to true to limit deep linking behavior of the generated link to a single use. Can also be set using type
        $custom_sms_text Text for SMS link sent for desktop clicks to this link. Must contain {{ link }} Value of Text me the app page in Settings
      • Content
        Key Default Usage
        $publicly_indexable 1 Cannot modify here. Needs to be set by the Branch Universal Object
        $keywords Keywords for which this content should be discovered by. Just assign an array of strings with the keywords you’d like to use
        $canonical_identifier This is the unique identifier for content that will help Branch dedupe across many instances of the same thing. Suitable options: a website with pathing, or a database with identifiers for entities
        $exp_date 0 Cannot modify here. Needs to be set by the Branch Universal Object
        $content_type This is a label for the type of content present. Apple recommends that you use uniform type identifier as described here
      • DeepView
        Key Default Usage
        $ios_deepview default_template The name of the deepview template to use for iOS
        $android_deepview default_template The name of the deepview template to use for Android
        $desktop_deepview default_template The name of the deepview template to use for the Desktop
      • Open Graph
        Key Default Usage
        $og_title Set the title of the link as it will be seen in social media displays
        $og_description Set the description of the link as it will be seen in social media displays
        $og_image_url Set the image of the link as it will be seen in social media displays
        $og_image_width Set the image’s width in pixels for social media displays
        $og_image_height Set the image’s height in pixels for social media displays
        $og_video Set a video as it will be seen in social media displays
        $og_url Set the base URL of the link as it will be seen in social media displays
        $og_type Set the type of custom card format link as it will be seen in social media displays
        $og_redirect (Advanced, not recommended) Set a custom URL that we redirect the social media robots to in order to retrieve all the appropriate tags
        $og_app_id (Rarely used) Sets the app id tag
      • Twitter
        Key Default Usage
        $twitter_card Set the Twitter card type of the link
        $twitter_title Set the title of the Twitter card
        $twitter_description Set the description of the Twitter card
        $twitter_image_url Set the image URL for the Twitter card
        $twitter_site Set the site for Twitter
        $twitter_app_country Set the app country for the app card
        $twitter_player Set the video player’s URL. Defaults to the value of $og_video.
        $twitter_player_width Set the player’s width in pixels
        $twitter_player_height Set the player’s height in pixels
    • Example ```js // optional fields var analytics = { channel: "channel", feature: "feature", campaign: "campaign", stage: "stage", tags: ["one","two","three"] };

      // optional fields var properties = { $fallback_url: "www.example.com", $desktop_url: "www.desktop.com", $android_url: "www.android.com", $ios_url: "www.ios.com", $ipad_url: "www.ipad.com", more_custom: "data", even_more_custom: true, this_is_custom: 41231 };

      branchUniversalObj.generateShortUrl(analytics, properties).then(function(res) { alert(JSON.stringify(res.url)); }).catch(function(err) { alert(JSON.stringify(err)); });

      </details>
      
      
  • Share Deep Link

    • Will generate a Branch deep link and tag it with the channel the user selects

    • Needs a Branch Universal Object

    • Analytics and Properties use the same key-value pairs as Create Deep Link

    • Example ```js // optional fields var analytics = { channel: "channel", feature: "feature", campaign: "campaign", stage: "stage", tags: ["one","two","three"] };

      // optional fields var properties = { $fallback_url: "www.example.com", $desktop_url: "www.desktop.com", $android_url: "www.android.com", $ios_url: "www.ios.com", $ipad_url: "www.ipad.com", more_custom: "data", even_more_custom: true, this_is_custom: 41231 };

      var message = "Check out this link";

      // optional listeners (must be called before showShareSheet) branchUniversalObj.onShareSheetLaunched(function(res) { // android only alert(JSON.stringify(res)); }); branchUniversalObj.onShareSheetDismissed(function(res) { alert(JSON.stringify(res)); }); branchUniversalObj.onLinkShareResponse(function(res) { alert(JSON.stringify(res)); }); branchUniversalObj.onChannelSelected(function(res) { // android only alert(JSON.stringify(res)); });

      // share sheet branchUniversalObj.showShareSheet(analytics, properties, message);

      </details>
      
      
  • Read Deep Link

    • Retrieve Branch data from a deep link

    • Best practice to receive data from DeepLinkHandler listener

    • Example (listener) > must be global functions
      // required
      function DeepLinkHandler(data) {
        if (data) {
          // window.location = "#/tab/chats/3"; // navigate to page based on data
          alert("Data Link handler response: " + JSON.stringify(data));
        }
      }
      
      // optional
      function NonBranchLinkHandler(data) {
        if (data) {
          alert("Non-branch link found: " + JSON.stringify(data));
        }
      }
    • Example (first data) ```js Branch.getFirstReferringParams().then(function(res) { alert("Response: " + JSON.stringify(res)); }).catch(function(err) { alert("Error: " + JSON.stringify(err)); }); ```
    • Example (latest data) ```js Branch.getLatestReferringParams().then(function(res) { alert("Response: " + JSON.stringify(res)); }).catch(function(err) { alert("Error: " + JSON.stringify(err)); }); ```
  • Show Content

    • List content on iOS Spotlight

    • Needs a Branch Universal Object

    • Example ```js branchUniversalObj.listOnSpotlight().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
  • Track Content

    • Track how many times a user views a particular piece of content

    • Needs a Branch Universal Object

    • Example ```js branchUniversalObj.registerView().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
  • Track User

    • Sets the identity of a user (email, ID, UUID, etc) for events, deep links, and referrals

    • Example (set) ```js var userId = "email_or_id"; Branch.setIdentity(userId).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
    • Example (logout) ```js Branch.logout().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
  • Track Event

    • Registers custom events

    • Must Track User before Track Event to associate events with a user

    • Example ```js var eventName = "clicked_on_this"; var metaData = { "custom_dictionary": 123 }; // optional Branch.userCompletedAction(eventName, metaData).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ``` ```js var eventName = "clicked_on_this"; Branch.userCompletedAction(eventName).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
  • Handle Referrals

    • Referral points are obtained from events triggered by users from rules created on the Branch Dashboard

    • Example (get credits) - Referrer is [tracked](#track-user)
    • Example (spend credits) ```js var amount = 10; var bucket = "this_bucket"; // optional Branch.redeemRewards(amount, bucket).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ``` ```js var amount = 10; Branch.redeemRewards(amount).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
    • Example (load credits) ```js var bucket = "this_bucket"; // optional Branch.loadRewards(bucket).then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ``` ```js Branch.loadRewards().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```
    • Example (load history) ```js Branch.creditHistory().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert(JSON.stringify(err)); }); ```

Troubleshooting

  • Testing: Key Points

    • Use the Branch key_live

    • Always use the DeepLinkHandler to read Deep Link data

    • Always test on device (simulator browser genymotion will break)

    • Other deep link plugins (ex cordova-universal-links-plugin) will interferer with Branch

  • Testing: Sample Testing App

  • Testing: Sample Integration App

    • Example (Ionic)
      • Install
      npm install -g cordova ionic;
      ionic start t3 tabs;
      cd t3;
      ionic platform add ios;
      ionic platform add android;
      ionic plugin remove io.branch.sdk;
      # values should be from your Branch Dashboard https://dashboard.branch.io/settings/link
      ionic plugin add https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git --variable BRANCH_KEY=key_live_jnBhaHwt5K8xtn4g4hblHoleqsocI6C2 --variable URI_SCHEME=branchionic;
      • Update config.xml
      <!-- values should be from your Branch Dashboard https://dashboard.branch.io/settings/link -->
      <widget id="com.eneff.branch.ionic" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/-0**">**
        <branch-config>
          <ios-team-id value="PW4Q8885U7"/>
          <host name="cluv.app.link" scheme="https"/>
          <host name="cluv-alternate.app.link" scheme="https"/>
        </branch-config>
      • update app.js
      // global function
      function DeepLinkHandler(data) {
        if (data) {
          alert('Data Link handler response: ' + JSON.stringify(data));
        }
      }
      
      angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
      
      .run(function($ionicPlatform) {
        $ionicPlatform.ready(function() {
          if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
            cordova.plugins.Keyboard.disableScroll(true);
          }
          if (window.StatusBar) {
            StatusBar.styleDefault();
          }
      
          // Branch
          $ionicPlatform.on('deviceready', function(){
            Branch.setDebug(true);
            Branch.initSession();
          });
        });
      })
      
      // ...
      • Delete app off device

      • Compile ionic

      ionic build ios;
      • Run on device through xcode
      open -a Xcode platforms/ios/t3.xcodeproj;
  • Testing: Show Console Logs

    • iOS Simulator - `cordova run ios;`
      • Safari -> Preferences -> Advance -> Show Develop menu in menu bar

      • Safari -> Develop -> Simulator -> index.html -> Console

      • May need to unplug and replug device

      • May need to open Xcode and update provisioning profile

    • iOS Xcode - `cordova plugin add cordova-plugin-console;`
      • cordova build ios;

      • Xcode -> APP_LOCATION/platforms/ios/APP_NAME.Xcodeproj

      • Xcode -> App -> General -> Signing -> Team

      • Xcode -> Product -> Run

      • Xcode -> View -> Debug Area -> Activate Console

    • Android Device - Plug device in
      • cordova run android;

      • Chrome -> chrome://inspect/#devices -> Console

    • Android Genymotion - Genymotion -> Start
      • cordova run android;

      • Chrome -> chrome://inspect/#devices -> Console

  • Testing: Supported Platforms

    • Apps which support Branch deep links
      iOS Details Android Details
      Facebook NewsFeed Works when DeepViews are enabled
      Facebook Messanger Works when DeepViews are enabled Works except the app.link domain is not clickable
      Twitter
      Pinterest Works when DeepViews are enabled 🅾️
      Slack
      Chrome address bar 🅾️ 🅾️
      Chrome web page
      FireFox address bar 🅾️
      FireFox web page
      Safari address bar 🅾️
      Safari web page
      WeChat 🅾️ 🅾️
      WhatsApp
      Hangouts
      iMessage
      Apple Mail
      Gmail
  • Testing: Simulating an Install

    • Add Branch.setDebug(true); before Branch.initSession();

    • Delete app

    • [iOS only] iPhone -> Settings -> Privacy -> Advertising -> Reset Advertising Identifier -> Reset Identifier

    • Click on deep link

    • Install app

    • Read from DeepLinkHandler for +is_first_session = true

  • Link Domain: Custom

    • Change PW4Q8885U7 and custom.domain.com to the values in your Branch Dashboard

    • Cordova and PhoneGap and Ionic ```xml ```
  • Link Domain: Bnc.lt

    • Change PW4Q8885U7 and /WSuf to the values in your Branch Dashboard

    • Cordova and PhoneGap and Ionic ```xml ```
  • Link Data: Convert to Ionic/Angular

    • Convert Branch deep link data from DeepLinkHandler into Ionic and Angular

    • Listen to Branch data, and save it into an Angular `DeepLink` factory ```js // must be a global function function DeepLinkHandler(data) { if (data) { // access the angular Factory("DeepLink") angular.element(document.querySelector("[ng-app]")).injector().get("DeepLink").set(data); console.log("Data Link handler response: " + JSON.stringify(data)); } else { console.error("Data Link handler no data"); } } ```
    • Create a `DeepLink` factory ```js angular.module("starter.services", []) .factory("DeepLink", function($window, $timeout) { var data = {};

      return { get: function() { return data; }, set: function(json) { // use the angular version of timeout $timeout(function() { // set the data data = json; // navigate example $window.location = "#/tab/chats/3"; }, 0); } }; });

      </details>
      
      
    • Access `DeepLink` factory ```js angular.module("starter.controllers", [])

      .controller("DashCtrl", function($scope, DeepLink) { $scope.content = {} $scope.buttonPressed = function() { // put branch data into a label that has ng-model content.data $scope.content.data = JSON.stringify(DeepLink.get()); }; })

      </details>
      
      
  • Link Data: Depreciated Methods

    • Before version 2.4.0, Branch used globally defined listeners to pass events generated by clicking on links outside your cordova app into it. To make this behavior more explicit, we've shifted to event listeners passed to the branch object via the branch.initSession(onBranchLinkHook) and branch.onNonBranchLink(hook). If you don't want to use these new methods and instead prefer the old global hooks without seeing warnings, call branch.disableGlobalListenersWarning().

    • branch.disableGlobalListenersWarnings(); turns off warnings about using global listeners.

  • Compiling: Updating the Branch SDK

    • Change xxxx, and xxxx to the values in your Branch Dashboard

    • Example ```bash # update cordova npm install -g cordova;

      remove old Branch SDK cache

      cordova platform remove ios; cordova platform remove android; cordova platform remove browser;

      update Branch SDK

      cordova plugin remove io.branch.sdk; cordova plugin add branch-cordova-sdk --variable BRANCH_KEY=xxxx --variable URI_SCHEME=xxxx;

      add platforms back

      cordova platform add ios; cordova platform add android;

      compile platform code

      cordova build ios; cordova build android;

      </details>
      
      
  • Compiling: Cordova Dependencies

    • Node ```sh /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; brew update; brew install node; ```
    • Xcode - Install [Xcode](https://developer.apple.com/download/)
      • Open Xcode -> agree to SDK license agreement

      • Open Xcode -> Create new Xcode project -> Run simulator -> Agree to developer mode on mac

    • Android Studio - Read [instructions](https://developer.android.com/studio/install.html)
      • Install JVM

      • Install Android Studio

      • Open Android Studio -> configure -> appearance/system settings/android sdk -> android 6.0 -> Okay

      • Open Android Studio -> New project -> ... -> Run -> Create new emulator -> Nexus 6p 23 -> Finish

        sudo cat >> ~/.bash_profile <<EOF
        
        export ANDROID_HOME=$HOME/Library/Android/sdk
        export PATH=$ANDROID_HOME/tools:$PATH
        export PATH=$ANDROID_HOME/platform-tools:$PATH
        EOF
        source ~/.bash_profile;
        android update sdk;
      • Install Android SDK build-tools 24.0.1

    • Genymotion *(optional)* - Install [Virtual Box](https://www.virtualbox.org/wiki/Downloads)
      • Install Genymotion

      • Genymotion -> Add virtual device -> Google Nexus 6P - 6.0.0 - API 23 -> Next

  • Compiling: Visual Studio TACO

    • Download the latest source code and import the Branch SDK locally
  • Compiling: Multiple support-lib v4s

    • Branch does not depend on the android-support-v4 file, but other Cordova plugins could cause an issue

    • Add `multiDexEnabled true` inside defaultConfig tag in `build.gradle` ```sh defaultConfig { multiDexEnabled true } ```
    • Remove the android-support-v4.jar in Android libs directory

    • Run ./gradlew clean in the Android directory

    • Run `android-support-v4` file for compiling ```sh compile ("com.google.android.gms:play-services-ads:9.+") { exclude module: "support-v4" } ```
  • Compiling: Missing Android Dependency

    • Gradle build cannot find io.branch.sdk.android:library:2.+ dependency

    • Add into your `build.gradle` file ```sh compile "io.branch.sdk.android:library:2.+" ```

Additional Documentation

About

The Cordova SDK for deferred deep linking is a thin wrapper around our native iOS/Android SDKs. Branch helps mobile apps grow with deep links / deeplinks that power referral systems, sharing links and invites with full attribution and analytics.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 73.7%
  • JavaScript 18.2%
  • Java 6.1%
  • HTML 0.8%
  • CSS 0.6%
  • Shell 0.3%
  • C 0.3%