Questions? Contact us
- Integration
- Features
- Troubleshooting
- Testing: Key Points
- Testing: Sample Testing App
- Testing: Sample Integration App
- Testing: Show Console Logs
- Testing: Supported Platforms
- Testing: Simulating an Install
- Link Domain: Custom
- Link Domain: Bnc.lt
- Link Data: Convert to Ionic/Angular
- Link Data: Global Listener Warning
- Compiling: Updating the Branch SDK
- Compiling: Cordova Dependencies
- Compiling: Visual Studio TACO
- Compiling: Multiple support-lib v4s
- Compiling: Missing Android Dependency
- Additional
-
-
Complete your Branch Dashboard
-
Example
![image](http://i.imgur.com/tkEolFM.png)
-
-
-
Change
key_live_hiuejxqEdbHR8Tc1L92nmiijrse9OBpq
andbranchcordova
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; ```
-
-
-
Change
com.eneff.branch.cordova
,PW4Q8885U7
,2d0s.app.link
, and2d0s-alternate.app.link
to the values in your Branch Dashboard -
Cordova and Ionic
```xml ``` -
PhoneGap
```xml ```
-
-
-
Cordova and PhoneGap
```js var app = { initialize: function() { this.bindEvents(); }, bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); document.addEventListener('resume', this.onDeviceReady, false); }, onDeviceReady: function() { app.branchInit(); }, onDeviceResume: function() { app.branchInit(); }, branchInit: function() { // Branch initialization Branch.initSession(function(data) { // read deep link data on click alert('Deep Link Data: ' + JSON.stringify(data)); }); } };app.initialize();
</details>
-
Ionic 1
```js // sample app.js 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 initialization Branch.initSession(function(data) { // read deep link data on click alert('Deep Link Data: ' + JSON.stringify(data)); });
}); }) // ...
</details>
-
Ionic 2
```typescript // sample app.component.js import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { StatusBar, Splashscreen } from 'ionic-native'; import { TabsPage } from '../pages/tabs/tabs';// Branch import declare var Branch;
@Component({ template:
<ion-nav [root]="rootPage"></ion-nav>
}) export class MyApp { rootPage = TabsPage;constructor(platform: Platform) { platform.ready().then(() => { StatusBar.styleDefault(); Splashscreen.hide();
// Branch initialization Branch.initSession(function(data) { // read deep link data on click alert('Deep Link Data: ' + JSON.stringify(data)); }); });
} }
</details>
-
-
-
Wait 15 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
) -
Open the app in Xcode and set your Provisioning Profile
Team
-
Launch your app to
device
(not Simulator or TestFlight) -
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)
-
-
-
Wait 15 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
(not Simulator or Genymotion) -
Paste deep link in Google Hangouts
-
Tap on the deep link to open app
-
-
-
Load Branch into your app. Must be called on
deviceReady
-
Example
```js // for development and debugging only Branch.setDebug(true);// sync with Mixpanel if installed Branch.setMixpanelToken('your_mixpanel_token');
// Branch initialization Branch.initSession(function(data) { // read deep link data on click alert('Deep Link Data: ' + JSON.stringify(data)); }).then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); });
</details>
-
-
-
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>
-
-
-
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 separatelyfeature 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 abovealias 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 legacybnc.lt
domain are incompatible with Universal Links and Spotlighttype 0
Set to 1
to limit deep linking behavior of the generated link to a single use. Set type to2
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: 321 };
branchUniversalObj.generateShortUrl(analytics, properties).then(function(res) { alert('Response: ' + JSON.stringify(res.url)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); });
</details>
-
-
-
Will generate a Branch deep link and tag it with the channel the user selects
-
Needs a Branch Universal Object
-
Analytics
andProperties
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: 321 };
var message = "Check out this link";
// optional listeners (must be called before showShareSheet) branchUniversalObj.onShareSheetLaunched(function(res) { // android only alert('Response: ' + JSON.stringify(res)); }); branchUniversalObj.onShareSheetDismissed(function(res) { alert('Response: ' + JSON.stringify(res)); }); branchUniversalObj.onLinkShareResponse(function(res) { alert('Response: ' + JSON.stringify(res)); }); branchUniversalObj.onChannelSelected(function(res) { // android only alert('Response: ' + JSON.stringify(res)); });
// share sheet branchUniversalObj.showShareSheet(analytics, properties, message);
</details>
-
-
-
Retrieve Branch data from a deep link
-
Best practice to receive data from the
listener
-
Example (listener)
```js // Branch initialization within your deviceReady Branch.initSession(function(deepLinkData) { // handler for deep link data on click alert(JSON.stringify(deepLinkData)); }); ``` -
Example (listener) *[depreciated]*
```html <script> // required function DeepLinkHandler(data) { if (data) { alert('Data Link Data Response: ' + JSON.stringify(data)); } }```// optional function NonBranchLinkHandler(data) { if (data) { alert('Non-Branch Link Detected: ' + JSON.stringify(data)); } } </script>
-
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)); }); ```
-
-
-
List content on iOS Spotlight
-
Needs a Branch Universal Object
-
Example
```js branchUniversalObj.listOnSpotlight().then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```
-
-
-
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('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```
-
-
-
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('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ``` -
Example (logout)
```js Branch.logout().then(function(res) { alert(JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```
-
-
-
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('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ``` ```js var eventName = "clicked_on_this"; Branch.userCompletedAction(eventName).then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```
-
-
-
Referral points are obtained from events triggered by users from rules created on the Branch Dashboard
-
Example (get credits)
- Referrer is [tracked](#track-user)-
Referrer creates a deep link
-
Referrer shares the deep Link
-
Referee clicks on deep link
-
Referee triggers a custom event
-
Catch the event in your Branch Dashboard as a rule
-
Referrer gets referral points
-
-
Example (spend credits)
```js var amount = 10; var bucket = 'this_bucket'; // optional Branch.redeemRewards(amount, bucket).then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```var amount = 10; Branch.redeemRewards(amount).then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); });
-
Example (load credits)
```js var bucket = 'this_bucket'; // optional Branch.loadRewards(bucket).then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```Branch.loadRewards().then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); });
-
Example (load history)
```js Branch.creditHistory().then(function(res) { alert('Response: ' + JSON.stringify(res)); }).catch(function(err) { alert('Error: ' + JSON.stringify(err)); }); ```
-
-
-
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
-
-
-
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/1.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;
- Click on a deep link in iMessage to open the app
-
For example, the deep link https://cluv.app.link/6TOiVlCqXx can be created from your Branch Dashboard
-
-
-
-
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
-
-
-
-
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 click-ableTwitter ✅ ✅ 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 ✅ ✅
-
-
-
Add
Branch.setDebug(true);
beforeBranch.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
-
-
-
Change
PW4Q8885U7
andcustom.domain.com
to the values in your Branch Dashboard -
Cordova and PhoneGap and Ionic
```xml ```
-
-
-
Change
PW4Q8885U7
and/WSuf
to the values in your Branch Dashboard -
Cordova and PhoneGap and Ionic
```xml ```
-
-
-
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)); } } ``` -
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>
-
-
-
After Branch SDK
2.4.0
, deep link data is handled withinBranch.initSession(DeepLinkDataFunction);
-
Use
Branch.disableGlobalListenersWarnings();
to turn off the warning errors generated fromDeepLinkHandler
andNonBranchLinkHandler
-
-
-
Change
xxxx
, andxxxx
to the values in your Branch Dashboard -
Example
```bash # update cordova npm install -g cordova;cordova platform remove ios; cordova platform remove android; cordova platform remove browser;
cordova plugin remove io.branch.sdk; cordova plugin add branch-cordova-sdk --variable BRANCH_KEY=xxxx --variable URI_SCHEME=xxxx;
cordova platform add ios; cordova platform add android;
cordova build ios; cordova build android;
</details>
-
-
-
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
# add to ~/.bash_profile export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/platform-tools:$PATH
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
-
-
-
- Download the latest source code and import the Branch SDK locally
-
-
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 Androidlibs
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" } ```
-
-
-
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.+" ```
-