diff --git a/.npmignore b/.npmignore index f077c34f..fcdc9df2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,7 @@ node_modules -.installed \ No newline at end of file +.installed +tests/ +testbed/ +plugin.template.xml +gulpfile.js +CONTRIBUTING.md \ No newline at end of file diff --git a/README.md b/README.md index a763404d..cd613cb1 100644 --- a/README.md +++ b/README.md @@ -42,21 +42,15 @@ - [Handle Referrals](#handle-referrals) - [Troubleshooting](#troubleshooting) - [Testing: Key Points](#testing-key-points) + - [Testing: Optional App Config](#testing-optional-app-config) - [Testing: Sample Testing App](#testing-sample-testing-app) - [Testing: Show Console Logs](#testing-show-console-logs) - [Testing: Supported Platforms](#testing-supported-platforms) - [Testing: Simulating an Install](#testing-simulating-an-install) - - [Testing: Optional App Config](#testing-optional-app-config) - [Link Data: Universal Object Properties](#link-data-universal-object-properties) - [Link Data: Deep Link Properties](#link-data-deep-link-properties) - - [Link Data: Convert to Ionic/Angular](#link-data-convert-to-ionicangular) - - [Link Data: Global Listener Warning](#link-data-global-listener-warning) - - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins) - - [Compiling: Updating the Branch SDK](#compiling-updating-the-branch-sdk) - [Compiling: Cordova Dependencies](#compiling-cordova-dependencies) - - [Compiling: Visual Studio TACO](#compiling-visual-studio-taco) - - [Compiling: Multiple support-lib v4s](#compiling-multiple-support-lib-v4s) - - [Compiling: Missing Android Dependency](#compiling-missing-android-dependency) + - [Compiling: Incompatible Plugins](#compiling-incompatible-plugins) - [Compiling: Errors](#compiling-errors) - [Additional](#additional) - [SDK Development](#sdk-development) @@ -64,7 +58,6 @@ - [Analytical Data](#analytical-data) - [Webpage Features](#webpage-features) - [Premium Features](#premium-feature) - - [Support](#support) ## Getting Started @@ -80,12 +73,12 @@ - Cordova and Ionic ```xml - + - + @@ -94,22 +87,22 @@ - PhoneGap ```xml - + - + ``` - Change the following values to match your [Branch Dashboard](https://dashboard.branch.io/settings/link) - - `com.eneff.branch.cordova_testbed` - - `cordovatestbed` + - `com.eneff.branch.cordovatestbed` + - `branchcordova` - `PW4Q8885U7` - - `testbed.app.link` + - `cordova.app.link` - #### Initialize Branch @@ -583,13 +576,28 @@ - Use the Branch `key_live` - - Always use the `Branch.initSession(function(data) {})` to read Deep Link data + - Use `Branch.initSession(function(data) {})` to read Deep Link data - - Always test on `device` (`simulator` `browser` `genymotion` will not work) + - Test on a `device` *(`simulator`, `browser`, and `genymotion` cause issues)* + - [Incompatible Plugins](#compiling-incompatible-plugins) - - You must launch the app through `Xcode` for iOS +- #### Testing: Optional App Config - - Other deep link plugins (e.g. `cordova-universal-links-plugin`) will interferer with Branch + ```xml + + + + + + + + + + + + + + ``` - #### Testing: Sample Testing App @@ -679,24 +687,6 @@ - Read from `Branch.initSession(data)` for `+is_first_session = true` -- #### Testing: Optional App Config - - ```xml - - - - - - - - - - - - - - ``` - - #### Link Data: Universal Object Properties - For [Create Content Reference](#create-content-reference) @@ -820,101 +810,6 @@ | $twitter_player_width | | Set the player’s width in pixels | $twitter_player_height | | Set the player’s height in pixels -- #### 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` - - ```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); - } - }; - }); - ``` - - - 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()); - }; - }) - ``` - -- #### Link Data: Global Listener Warning - - - After Branch SDK `2.4.0`, deep link data is handled within `Branch.initSession(DeepLinkDataFunction);` - - - Listener *[depreciated in 2.4.0]* - ```html - - - - - ``` - - - Use `Branch.disableGlobalListenersWarnings();` to turn off the warning errors generated from `DeepLinkHandler` and `NonBranchLinkHandler` - -- #### Compiling: Incompatible Plugins - - - The following plugins will not work with the Branch SDK - - - [PhoneGap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc) - - - [Custom URL scheme](https://github.com/EddyVerbruggen/Custom-URL-scheme) - - - [Cordova Universal Links Plugin](https://github.com/nordnet/cordova-universal-links-plugin) - - - [Ionic Deeplinks Plugin](https://github.com/driftyco/ionic-plugin-deeplinks) - - #### Compiling: Cordova Dependencies - Node @@ -970,43 +865,17 @@ - Genymotion -> Add virtual device -> Google Nexus 6P - 6.0.0 - API 23 -> Next -- #### Compiling: Visual Studio TACO - - - Download the latest [source code](https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/releases) 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 +- #### Compiling: Incompatible Plugins - ```sh - compile ("com.google.android.gms:play-services-ads:9.+") { - exclude module: "support-v4" - } - ``` + - The following plugins will not work with the Branch SDK -- #### Compiling: Missing Android Dependency + - [PhoneGap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc) - - Gradle build cannot find `io.branch.sdk.android:library:2.+` dependency + - [Custom URL scheme](https://github.com/EddyVerbruggen/Custom-URL-scheme) - - Add into your `build.gradle` file + - [Cordova Universal Links Plugin](https://github.com/nordnet/cordova-universal-links-plugin) - ```sh - compile "io.branch.sdk.android:library:2.+" - ``` + - [Ionic Deeplinks Plugin](https://github.com/driftyco/ionic-plugin-deeplinks) - #### Compiling: Errors @@ -1097,9 +966,3 @@ - [Deep Link Emails](https://dev.branch.io/premium-solutions/) - [Data Integrations](https://dev.branch.io/premium-solutions/) - -- #### Support - - - [Documentation](https://dev.branch.io/) - - - [Contact](https://support.branch.io/support/tickets/new) diff --git a/gulpfile.js b/gulpfile.js index 56d7e896..b514d982 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,10 +14,9 @@ gulp.task('lint', ['standard']) gulp.task('standard', function () { // standard format for javascript var javascript = [ - './hooks/**/*.js', + './src/**/*.js', './testbed/www/js/**/*.js', - './gulpfile.js', - './www/branch.js' + './gulpfile.js' ] return gulp.src(javascript) diff --git a/plugin.template.xml b/plugin.template.xml index 0188943d..7e161727 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -47,11 +47,11 @@ SOFTWARE. - - + + - + diff --git a/plugin.xml b/plugin.xml index e5442a6c..c80d422d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -47,11 +47,11 @@ SOFTWARE. - - + + - + diff --git a/www/branch.js b/src/branch.js similarity index 100% rename from www/branch.js rename to src/branch.js diff --git a/hooks/afterPrepare.js b/src/scripts/afterPrepare.js similarity index 100% rename from hooks/afterPrepare.js rename to src/scripts/afterPrepare.js diff --git a/hooks/beforePluginInstall.js b/src/scripts/beforePluginInstall.js similarity index 100% rename from hooks/beforePluginInstall.js rename to src/scripts/beforePluginInstall.js diff --git a/hooks/lib/android/androidManifest.js b/src/scripts/lib/android/androidManifest.js similarity index 100% rename from hooks/lib/android/androidManifest.js rename to src/scripts/lib/android/androidManifest.js diff --git a/hooks/lib/ios/associatedDomains.js b/src/scripts/lib/ios/associatedDomains.js similarity index 100% rename from hooks/lib/ios/associatedDomains.js rename to src/scripts/lib/ios/associatedDomains.js diff --git a/hooks/lib/ios/capabilities.js b/src/scripts/lib/ios/capabilities.js similarity index 100% rename from hooks/lib/ios/capabilities.js rename to src/scripts/lib/ios/capabilities.js diff --git a/hooks/lib/ios/developmentTeam.js b/src/scripts/lib/ios/developmentTeam.js similarity index 100% rename from hooks/lib/ios/developmentTeam.js rename to src/scripts/lib/ios/developmentTeam.js diff --git a/hooks/lib/ios/plist.js b/src/scripts/lib/ios/plist.js similarity index 100% rename from hooks/lib/ios/plist.js rename to src/scripts/lib/ios/plist.js diff --git a/hooks/lib/npm/nodeDependencies.js b/src/scripts/lib/npm/nodeDependencies.js similarity index 100% rename from hooks/lib/npm/nodeDependencies.js rename to src/scripts/lib/npm/nodeDependencies.js diff --git a/hooks/lib/sdk/configXml.js b/src/scripts/lib/sdk/configXml.js similarity index 100% rename from hooks/lib/sdk/configXml.js rename to src/scripts/lib/sdk/configXml.js diff --git a/hooks/lib/sdk/xmlHelper.js b/src/scripts/lib/sdk/xmlHelper.js similarity index 100% rename from hooks/lib/sdk/xmlHelper.js rename to src/scripts/lib/sdk/xmlHelper.js diff --git a/testbed/config.xml b/testbed/config.xml index 12dbec5f..448a8ded 100644 --- a/testbed/config.xml +++ b/testbed/config.xml @@ -1,12 +1,13 @@ - - + + + - + Branch Testing diff --git a/tests-harness/.gitignore b/tests/tests-harness/.gitignore similarity index 100% rename from tests-harness/.gitignore rename to tests/tests-harness/.gitignore diff --git a/tests-harness/README.md b/tests/tests-harness/README.md similarity index 100% rename from tests-harness/README.md rename to tests/tests-harness/README.md diff --git a/tests-harness/android-test.sh b/tests/tests-harness/android-test.sh similarity index 100% rename from tests-harness/android-test.sh rename to tests/tests-harness/android-test.sh diff --git a/tests-harness/config.xml b/tests/tests-harness/config.xml similarity index 100% rename from tests-harness/config.xml rename to tests/tests-harness/config.xml diff --git a/tests-harness/hooks/README.md b/tests/tests-harness/hooks/README.md similarity index 100% rename from tests-harness/hooks/README.md rename to tests/tests-harness/hooks/README.md diff --git a/tests-harness/init.sh b/tests/tests-harness/init.sh similarity index 100% rename from tests-harness/init.sh rename to tests/tests-harness/init.sh diff --git a/tests-harness/ios-test.sh b/tests/tests-harness/ios-test.sh similarity index 100% rename from tests-harness/ios-test.sh rename to tests/tests-harness/ios-test.sh diff --git a/tests-harness/www/css/index.css b/tests/tests-harness/www/css/index.css similarity index 100% rename from tests-harness/www/css/index.css rename to tests/tests-harness/www/css/index.css diff --git a/tests-harness/www/img/logo.png b/tests/tests-harness/www/img/logo.png similarity index 100% rename from tests-harness/www/img/logo.png rename to tests/tests-harness/www/img/logo.png diff --git a/tests-harness/www/index.html b/tests/tests-harness/www/index.html similarity index 100% rename from tests-harness/www/index.html rename to tests/tests-harness/www/index.html diff --git a/tests-harness/www/js/index.js b/tests/tests-harness/www/js/index.js similarity index 100% rename from tests-harness/www/js/index.js rename to tests/tests-harness/www/js/index.js