Skip to content

Commit 5365ad3

Browse files
authored
Merge pull request #285 from BranchMetrics/minor_cleanup
fix: minor cleanup
2 parents 41da207 + 8c3c5cb commit 5365ad3

28 files changed

+52
-184
lines changed

.npmignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
node_modules
2-
.installed
2+
.installed
3+
tests/
4+
testbed/
5+
plugin.template.xml
6+
gulpfile.js
7+
CONTRIBUTING.md

README.md

Lines changed: 34 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,22 @@
4242
- [Handle Referrals](#handle-referrals)
4343
- [Troubleshooting](#troubleshooting)
4444
- [Testing: Key Points](#testing-key-points)
45+
- [Testing: Optional App Config](#testing-optional-app-config)
4546
- [Testing: Sample Testing App](#testing-sample-testing-app)
4647
- [Testing: Show Console Logs](#testing-show-console-logs)
4748
- [Testing: Supported Platforms](#testing-supported-platforms)
4849
- [Testing: Simulating an Install](#testing-simulating-an-install)
49-
- [Testing: Optional App Config](#testing-optional-app-config)
5050
- [Link Data: Universal Object Properties](#link-data-universal-object-properties)
5151
- [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)
5652
- [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)
6054
- [Compiling: Errors](#compiling-errors)
6155
- [Additional](#additional)
6256
- [SDK Development](#sdk-development)
6357
- [Bulk Link Creation](#bulk-link-creation)
6458
- [Analytical Data](#analytical-data)
6559
- [Webpage Features](#webpage-features)
6660
- [Premium Features](#premium-feature)
67-
- [Support](#support)
6861

6962
## Getting Started
7063

@@ -80,12 +73,12 @@
8073
- Cordova and Ionic
8174
```xml
8275
<!-- 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">
8477
<!-- Branch -->
8578
<plugin name="branch-cordova-sdk" />
8679
<branch-config>
8780
<branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
88-
<uri-scheme value="cordovatestbed" />
81+
<uri-scheme value="branchcordova" />
8982
<link-domain value="cordova.app.link" />
9083
<ios-team-release value="PW4Q8885U7" />
9184
</branch-config>
@@ -94,22 +87,22 @@
9487
- PhoneGap
9588
```xml
9689
<!-- 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">
9891
<!-- Branch -->
9992
<plugin name="branch-cordova-sdk" />
10093
<branch-config>
10194
<branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
102-
<uri-scheme value="cordovatestbed" />
95+
<uri-scheme value="branchcordova" />
10396
<link-domain value="cordova.app.link" />
10497
<ios-team-prod value="PW4Q8885U7" />
10598
</branch-config>
10699
```
107100

108101
- 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`
111104
- `PW4Q8885U7`
112-
- `testbed.app.link`
105+
- `cordova.app.link`
113106

114107
- #### Initialize Branch
115108

@@ -583,13 +576,28 @@
583576

584577
- Use the Branch `key_live`
585578

586-
- Always use the `Branch.initSession(function(data) {})` to read Deep Link data
579+
- Use `Branch.initSession(function(data) {})` to read Deep Link data
587580

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)
589583

590-
- You must launch the app through `Xcode` for iOS
584+
- #### Testing: Optional App Config
591585

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+
```
593601

594602
- #### Testing: Sample Testing App
595603

@@ -679,24 +687,6 @@
679687

680688
- Read from `Branch.initSession(data)` for `+is_first_session = true`
681689

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-
700690
- #### Link Data: Universal Object Properties
701691

702692
- For [Create Content Reference](#create-content-reference)
@@ -820,101 +810,6 @@
820810
| $twitter_player_width | | Set the player’s width in pixels
821811
| $twitter_player_height | | Set the player’s height in pixels
822812

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-
918813
- #### Compiling: Cordova Dependencies
919814

920815
- Node
@@ -970,43 +865,17 @@
970865

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

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
994869

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
1000871

1001-
- #### Compiling: Missing Android Dependency
872+
- [PhoneGap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc)
1002873

1003-
- Gradle build cannot find `io.branch.sdk.android:library:2.+` dependency
874+
- [Custom URL scheme](https://github.com/EddyVerbruggen/Custom-URL-scheme)
1004875

1005-
- Add into your `build.gradle` file
876+
- [Cordova Universal Links Plugin](https://github.com/nordnet/cordova-universal-links-plugin)
1006877

1007-
```sh
1008-
compile "io.branch.sdk.android:library:2.+"
1009-
```
878+
- [Ionic Deeplinks Plugin](https://github.com/driftyco/ionic-plugin-deeplinks)
1010879

1011880
- #### Compiling: Errors
1012881

@@ -1097,9 +966,3 @@
1097966
- [Deep Link Emails](https://dev.branch.io/premium-solutions/)
1098967
1099968
- [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)

gulpfile.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ gulp.task('lint', ['standard'])
1414
gulp.task('standard', function () {
1515
// standard format for javascript
1616
var javascript = [
17-
'./hooks/**/*.js',
17+
'./src/**/*.js',
1818
'./testbed/www/js/**/*.js',
19-
'./gulpfile.js',
20-
'./www/branch.js'
19+
'./gulpfile.js'
2120
]
2221

2322
return gulp.src(javascript)

plugin.template.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ SOFTWARE.
4747
</engines>
4848

4949
<!-- Hooks -->
50-
<hook src="hooks/beforePluginInstall.js" type="before_plugin_install" />
51-
<hook src="hooks/afterPrepare.js" type="after_prepare" />
50+
<hook src="src/scripts/beforePluginInstall.js" type="before_plugin_install" />
51+
<hook src="src/scripts/afterPrepare.js" type="after_prepare" />
5252

5353
<!-- JavaScript -->
54-
<js-module src="www/branch.js" name="Branch">
54+
<js-module src="src/branch.js" name="Branch">
5555
<clobbers target="Branch" />
5656
</js-module>
5757

plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ SOFTWARE.
4747
</engines>
4848

4949
<!-- Hooks -->
50-
<hook src="hooks/beforePluginInstall.js" type="before_plugin_install" />
51-
<hook src="hooks/afterPrepare.js" type="after_prepare" />
50+
<hook src="src/scripts/beforePluginInstall.js" type="before_plugin_install" />
51+
<hook src="src/scripts/afterPrepare.js" type="after_prepare" />
5252

5353
<!-- JavaScript -->
54-
<js-module src="www/branch.js" name="Branch">
54+
<js-module src="src/branch.js" name="Branch">
5555
<clobbers target="Branch" />
5656
</js-module>
5757

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)