|
42 | 42 | - [Handle Referrals](#handle-referrals) |
43 | 43 | - [Troubleshooting](#troubleshooting) |
44 | 44 | - [Testing: Key Points](#testing-key-points) |
| 45 | + - [Testing: Optional App Config](#testing-optional-app-config) |
45 | 46 | - [Testing: Sample Testing App](#testing-sample-testing-app) |
46 | 47 | - [Testing: Show Console Logs](#testing-show-console-logs) |
47 | 48 | - [Testing: Supported Platforms](#testing-supported-platforms) |
48 | 49 | - [Testing: Simulating an Install](#testing-simulating-an-install) |
49 | | - - [Testing: Optional App Config](#testing-optional-app-config) |
50 | 50 | - [Link Data: Universal Object Properties](#link-data-universal-object-properties) |
51 | 51 | - [Link Data: Deep Link Properties](#link-data-deep-link-properties) |
52 | | - - [Link Data: Convert to Ionic/Angular](#link-data-convert-to-ionicangular) |
53 | | - - [Link Data: Global Listener Warning](#link-data-global-listener-warning) |
54 | | - - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins) |
55 | | - - [Compiling: Updating the Branch SDK](#compiling-updating-the-branch-sdk) |
56 | 52 | - [Compiling: Cordova Dependencies](#compiling-cordova-dependencies) |
57 | | - - [Compiling: Visual Studio TACO](#compiling-visual-studio-taco) |
58 | | - - [Compiling: Multiple support-lib v4s](#compiling-multiple-support-lib-v4s) |
59 | | - - [Compiling: Missing Android Dependency](#compiling-missing-android-dependency) |
| 53 | + - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins) |
60 | 54 | - [Compiling: Errors](#compiling-errors) |
61 | 55 | - [Additional](#additional) |
62 | 56 | - [SDK Development](#sdk-development) |
63 | 57 | - [Bulk Link Creation](#bulk-link-creation) |
64 | 58 | - [Analytical Data](#analytical-data) |
65 | 59 | - [Webpage Features](#webpage-features) |
66 | 60 | - [Premium Features](#premium-feature) |
67 | | - - [Support](#support) |
68 | 61 |
|
69 | 62 | ## Getting Started |
70 | 63 |
|
|
80 | 73 | - Cordova and Ionic |
81 | 74 | ```xml |
82 | 75 | <!-- sample config.xml --> |
83 | | - <widget id="com.eneff.branch.cordova_testbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> |
| 76 | + <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"> |
84 | 77 | <!-- Branch --> |
85 | 78 | <plugin name="branch-cordova-sdk" /> |
86 | 79 | <branch-config> |
87 | 80 | <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" /> |
88 | | - <uri-scheme value="cordovatestbed" /> |
| 81 | + <uri-scheme value="branchcordova" /> |
89 | 82 | <link-domain value="cordova.app.link" /> |
90 | 83 | <ios-team-release value="PW4Q8885U7" /> |
91 | 84 | </branch-config> |
|
94 | 87 | - PhoneGap |
95 | 88 | ```xml |
96 | 89 | <!-- sample config.xml --> |
97 | | - <widget id="com.eneff.branch.cordova_testbed" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"> |
| 90 | + <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"> |
98 | 91 | <!-- Branch --> |
99 | 92 | <plugin name="branch-cordova-sdk" /> |
100 | 93 | <branch-config> |
101 | 94 | <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" /> |
102 | | - <uri-scheme value="cordovatestbed" /> |
| 95 | + <uri-scheme value="branchcordova" /> |
103 | 96 | <link-domain value="cordova.app.link" /> |
104 | 97 | <ios-team-prod value="PW4Q8885U7" /> |
105 | 98 | </branch-config> |
106 | 99 | ``` |
107 | 100 |
|
108 | 101 | - Change the following values to match your [Branch Dashboard](https://dashboard.branch.io/settings/link) |
109 | | - - `com.eneff.branch.cordova_testbed` |
110 | | - - `cordovatestbed` |
| 102 | + - `com.eneff.branch.cordovatestbed` |
| 103 | + - `branchcordova` |
111 | 104 | - `PW4Q8885U7` |
112 | | - - `testbed.app.link` |
| 105 | + - `cordova.app.link` |
113 | 106 |
|
114 | 107 | - #### Initialize Branch |
115 | 108 |
|
|
583 | 576 |
|
584 | 577 | - Use the Branch `key_live` |
585 | 578 |
|
586 | | - - Always use the `Branch.initSession(function(data) {})` to read Deep Link data |
| 579 | + - Use `Branch.initSession(function(data) {})` to read Deep Link data |
587 | 580 |
|
588 | | - - Always test on `device` (`simulator` `browser` `genymotion` will not work) |
| 581 | + - Test on a `device` *(`simulator`, `browser`, and `genymotion` cause issues)* |
| 582 | + - [Incompatible Plugins](#compiling-incompatible-plugins) |
589 | 583 |
|
590 | | - - You must launch the app through `Xcode` for iOS |
| 584 | +- #### Testing: Optional App Config |
591 | 585 |
|
592 | | - - Other deep link plugins (e.g. `cordova-universal-links-plugin`) will interferer with Branch |
| 586 | + ```xml |
| 587 | + <!-- sample config.xml --> |
| 588 | + <widget id="com.eneff.branch.cordovatestbed" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> |
| 589 | + <!-- Branch --> |
| 590 | + <plugin name="branch-cordova-sdk" spec="~2.4.2" /> <!-- optional spec --> |
| 591 | + <branch-config> |
| 592 | + <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" /> |
| 593 | + <uri-scheme value="branchcordova" /> |
| 594 | + <link-domain value="cordova.app.link" /> |
| 595 | + <ios-team-release value="PW4Q8885U7" /> |
| 596 | + <ios-team-debug value="FG35JLLMXX" /> <!-- optional --> |
| 597 | + <android-prefix value="/WSuf" /> <!-- optional (for bnc.lt) --> |
| 598 | + <android-testmode value="true" /> <!-- optional (simulate installs) --> |
| 599 | + </branch-config> |
| 600 | + ``` |
593 | 601 |
|
594 | 602 | - #### Testing: Sample Testing App |
595 | 603 |
|
|
679 | 687 |
|
680 | 688 | - Read from `Branch.initSession(data)` for `+is_first_session = true` |
681 | 689 |
|
682 | | -- #### Testing: Optional App Config |
683 | | - |
684 | | - ```xml |
685 | | - <!-- sample config.xml --> |
686 | | - <widget id="com.eneff.branch.example" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> |
687 | | - <!-- Branch --> |
688 | | - <plugin name="branch-cordova-sdk" spec="~2.4.2" /> <!-- optional spec --> |
689 | | - <branch-config> |
690 | | - <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" /> |
691 | | - <uri-scheme value="cordovatestbed" /> |
692 | | - <link-domain value="testbed.app.link" /> |
693 | | - <ios-team-release value="PW4Q8885U7" /> |
694 | | - <ios-team-debug value="FG35JLLMXX" /> <!-- optional --> |
695 | | - <android-prefix value="/WSuf" /> <!-- optional (for bnc.lt) --> |
696 | | - <android-testmode value="true" /> <!-- optional (simulate installs) --> |
697 | | - </branch-config> |
698 | | - ``` |
699 | | - |
700 | 690 | - #### Link Data: Universal Object Properties |
701 | 691 |
|
702 | 692 | - For [Create Content Reference](#create-content-reference) |
|
820 | 810 | | $twitter_player_width | | Set the player’s width in pixels |
821 | 811 | | $twitter_player_height | | Set the player’s height in pixels |
822 | 812 |
|
823 | | -- #### Link Data: Convert to Ionic/Angular |
824 | | - |
825 | | - - Convert Branch deep link data from `DeepLinkHandler` into Ionic and Angular |
826 | | - |
827 | | - - Listen to Branch data, and save it into an Angular `DeepLink` |
828 | | - |
829 | | - ```js |
830 | | - // must be a global function |
831 | | - function DeepLinkHandler(data) { |
832 | | - if (data) { |
833 | | - // access the angular Factory('DeepLink') |
834 | | - angular.element(document.querySelector('[ng-app]')).injector().get('DeepLink').set(data); |
835 | | - console.log('Data Link handler response: ' + JSON.stringify(data)); |
836 | | - } |
837 | | - } |
838 | | - ``` |
839 | | - |
840 | | - - Create a `DeepLink` factory |
841 | | - |
842 | | - ```js |
843 | | - angular.module('starter.services', []) |
844 | | - .factory('DeepLink', function($window, $timeout) { |
845 | | - var data = {}; |
846 | | -
|
847 | | - return { |
848 | | - get: function() { |
849 | | - return data; |
850 | | - }, |
851 | | - set: function(json) { |
852 | | - // use the angular version of timeout |
853 | | - $timeout(function() { |
854 | | - // set the data |
855 | | - data = json; |
856 | | - // navigate example |
857 | | - $window.location = '#/tab/chats/3'; |
858 | | - }, 0); |
859 | | - } |
860 | | - }; |
861 | | - }); |
862 | | - ``` |
863 | | - |
864 | | - - Access `DeepLink` factory |
865 | | - |
866 | | - ```js |
867 | | - angular.module('starter.controllers', []) |
868 | | -
|
869 | | - .controller('DashCtrl', function($scope, DeepLink) { |
870 | | - $scope.content = {} |
871 | | - $scope.buttonPressed = function() { |
872 | | - // put branch data into a label that has ng-model content.data |
873 | | - $scope.content.data = JSON.stringify(DeepLink.get()); |
874 | | - }; |
875 | | - }) |
876 | | - ``` |
877 | | - |
878 | | -- #### Link Data: Global Listener Warning |
879 | | - |
880 | | - - After Branch SDK `2.4.0`, deep link data is handled within `Branch.initSession(DeepLinkDataFunction);` |
881 | | - |
882 | | - - Listener *[depreciated in 2.4.0]* |
883 | | - ```html |
884 | | - <!-- sample index.html --> |
885 | | - <script> |
886 | | - // required |
887 | | - function DeepLinkHandler(data) { |
888 | | - if (data) { |
889 | | - alert('Data Link Data Response: ' + JSON.stringify(data)); |
890 | | - } |
891 | | - } |
892 | | -
|
893 | | - // optional |
894 | | - function NonBranchLinkHandler(data) { |
895 | | - if (data) { |
896 | | - alert('Non-Branch Link Detected: ' + JSON.stringify(data)); |
897 | | - } |
898 | | - } |
899 | | - </script> |
900 | | - </body> |
901 | | - </html> |
902 | | - ``` |
903 | | - |
904 | | - - Use `Branch.disableGlobalListenersWarnings();` to turn off the warning errors generated from `DeepLinkHandler` and `NonBranchLinkHandler` |
905 | | - |
906 | | -- #### Compiling: Incompatible Plugins |
907 | | - |
908 | | - - The following plugins will not work with the Branch SDK |
909 | | - |
910 | | - - [PhoneGap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc) |
911 | | - |
912 | | - - [Custom URL scheme](https://github.com/EddyVerbruggen/Custom-URL-scheme) |
913 | | - |
914 | | - - [Cordova Universal Links Plugin](https://github.com/nordnet/cordova-universal-links-plugin) |
915 | | - |
916 | | - - [Ionic Deeplinks Plugin](https://github.com/driftyco/ionic-plugin-deeplinks) |
917 | | - |
918 | 813 | - #### Compiling: Cordova Dependencies |
919 | 814 |
|
920 | 815 | - Node |
|
970 | 865 |
|
971 | 866 | - Genymotion -> Add virtual device -> Google Nexus 6P - 6.0.0 - API 23 -> Next |
972 | 867 |
|
973 | | -- #### Compiling: Visual Studio TACO |
974 | | - |
975 | | - - Download the latest [source code](https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/releases) and import the Branch SDK locally |
976 | | - |
977 | | -- #### Compiling: Multiple support-lib v4s |
978 | | - |
979 | | - - Branch does not depend on the `android-support-v4` file, but other Cordova plugins could cause an issue |
980 | | - |
981 | | - - Add `multiDexEnabled true` inside defaultConfig tag in `build.gradle` |
982 | | - |
983 | | - ```sh |
984 | | - defaultConfig { |
985 | | - multiDexEnabled true |
986 | | - } |
987 | | - ``` |
988 | | - |
989 | | - - Remove the `android-support-v4.jar` in Android `libs` directory |
990 | | - |
991 | | - - Run `./gradlew clean` in the Android directory |
992 | | - |
993 | | - - Run `android-support-v4` file for compiling |
| 868 | +- #### Compiling: Incompatible Plugins |
994 | 869 |
|
995 | | - ```sh |
996 | | - compile ("com.google.android.gms:play-services-ads:9.+") { |
997 | | - exclude module: "support-v4" |
998 | | - } |
999 | | - ``` |
| 870 | + - The following plugins will not work with the Branch SDK |
1000 | 871 |
|
1001 | | -- #### Compiling: Missing Android Dependency |
| 872 | + - [PhoneGap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc) |
1002 | 873 |
|
1003 | | - - Gradle build cannot find `io.branch.sdk.android:library:2.+` dependency |
| 874 | + - [Custom URL scheme](https://github.com/EddyVerbruggen/Custom-URL-scheme) |
1004 | 875 |
|
1005 | | - - Add into your `build.gradle` file |
| 876 | + - [Cordova Universal Links Plugin](https://github.com/nordnet/cordova-universal-links-plugin) |
1006 | 877 |
|
1007 | | - ```sh |
1008 | | - compile "io.branch.sdk.android:library:2.+" |
1009 | | - ``` |
| 878 | + - [Ionic Deeplinks Plugin](https://github.com/driftyco/ionic-plugin-deeplinks) |
1010 | 879 |
|
1011 | 880 | - #### Compiling: Errors |
1012 | 881 |
|
|
1097 | 966 | - [Deep Link Emails](https://dev.branch.io/premium-solutions/) |
1098 | 967 |
|
1099 | 968 | - [Data Integrations](https://dev.branch.io/premium-solutions/) |
1100 | | -
|
1101 | | -- #### Support |
1102 | | -
|
1103 | | - - [Documentation](https://dev.branch.io/) |
1104 | | -
|
1105 | | - - [Contact](https://support.branch.io/support/tickets/new) |
0 commit comments