Skip to content

Commit

Permalink
Merge pull request #275 from BranchMetrics/example-app-branch-ids
Browse files Browse the repository at this point in the history
Example app Branch IDs
  • Loading branch information
jdee authored Oct 2, 2017
2 parents 4f5c539 + 7c6ed94 commit c5fba7f
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 144 deletions.
26 changes: 0 additions & 26 deletions examples/Branchfile

This file was deleted.

3 changes: 1 addition & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Once this is done, you can deploy the app on a device and open Universal Links i

To use this tool:

1. Edit the [Branchfile](./Branchfile) in this directory to use the correct parameters for your app from the
Branch Dashboard.
1. Edit the Branchfile in the fastlane subdirectory of any example you wish to use, e.g. [webview_example/fastlane/Branchfile](./webview_example/fastlane/Branchfile)
2. To update any example app, e.g. `webview_example`:
```bash
bundle install
Expand Down
4 changes: 2 additions & 2 deletions examples/browser_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ deep links rather than a web redirect. It accomplishes this using the
`branch.openURL` method.

To test it in a simulator or emulator without modification, enter the following
URL in the text input: https://wujv.test-app.link/pguRzO2ihG. The webview will
load the Wikipedia page for the planet Neptune.
URL in the text input: https://b8e9.test-app.link/browser. The webview will
load the following Wikipedia page: https://en.wikipedia.org/wiki/Web_browser.

## Building

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myurischeme" android:host="open"/>
<data android:scheme="https" android:host="branchwebview.app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.app.link"/>
<data android:scheme="https" android:host="branchwebview.test-app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.test-app.link"/>
<data android:scheme="https" android:host="b8e9.app.link"/>
<data android:scheme="https" android:host="b8e9-alternate.app.link"/>
<data android:scheme="https" android:host="b8e9.test-app.link"/>
<data android:scheme="https" android:host="b8e9-alternate.test-app.link"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ"/>
</application>
</manifest>
1 change: 0 additions & 1 deletion examples/browser_example/fastlane/Branchfile

This file was deleted.

26 changes: 26 additions & 0 deletions examples/browser_example/fastlane/Branchfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Edit the configuration below.
# Change to any example project folder and run fastlane update_branch.

# bundle install
# cd webview_example
# bundle exec fastlane update_branch

# iOS projects: Also validate the Universal Link configuration with
# bundle exec fastlane validate

# -----

patch_source false
add_sdk false

# Branch configuration defaults

live_key "key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN"
test_key "key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ"
app_link_subdomain "b8e9"

# Use instead of app_link_subdomain for custom domains:
# domains %w{example.com www.example.com}

# Android only
uri_scheme "myurischeme"
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.browser-example";
PRODUCT_NAME = browser_example;
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -1212,7 +1212,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.browser-example";
PRODUCT_NAME = browser_example;
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
4 changes: 2 additions & 2 deletions examples/browser_example/ios/browser_example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
<key>branch_key</key>
<dict>
<key>live</key>
<string>key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S</string>
<string>key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN</string>
<key>test</key>
<string>key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9</string>
<string>key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ</string>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:branchwebview.app.link</string>
<string>applinks:branchwebview-alternate.app.link</string>
<string>applinks:branchwebview.test-app.link</string>
<string>applinks:branchwebview-alternate.test-app.link</string>
<string>applinks:b8e9.app.link</string>
<string>applinks:b8e9-alternate.app.link</string>
<string>applinks:b8e9.test-app.link</string>
<string>applinks:b8e9-alternate.test-app.link</string>
</array>
</dict>
</plist>
38 changes: 1 addition & 37 deletions examples/browser_example/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { StyleSheet, Text, TextInput, TouchableHighlight, View, WebView } from 'react-native'
import { StyleSheet, Text, TextInput, View, WebView } from 'react-native'

import branch, { RegisterViewEvent } from 'react-native-branch'

Expand All @@ -15,13 +15,6 @@ const styles = StyleSheet.create({
webView: {
flex: 0.77
},
button: {
backgroundColor: '#cceeee',
borderColor: '#2266aa',
borderTopWidth: 1,
flex: 0.15,
justifyContent: 'center'
},
buttonText: {
color: '#2266aa',
fontSize: 23,
Expand Down Expand Up @@ -85,14 +78,6 @@ export default class App extends Component {
style={styles.webView}
source={{uri: this.state.url}}
onLoad={this.registerView.bind(this)} />
<TouchableHighlight
onPress={() => this.onShare()}
style={styles.button} >
<Text
style={styles.buttonText}>
Share
</Text>
</TouchableHighlight>
</View>
)
}
Expand All @@ -114,25 +99,4 @@ export default class App extends Component {
this.buo.userCompletedAction(RegisterViewEvent)
console.log("Created Branch Universal Object and logged RegisterViewEvent.")
}

async onShare() {
let { channel, completed, error } = await this.buo.showShareSheet({
emailSubject: "The Planet " + this.props.route.title,
messageBody: "Read about the planet " + this.props.route.title + ".",
messageHeader: "The Planet " + this.props.route.title
}, {
feature: "share",
channel: "RNApp"
}, {
$desktop_url: this.props.route.url,
$ios_deepview: "branch_default"
})

if (error) {
console.error("Error sharing via Branch: " + error)
return
}

console.log("Share to " + channel + " completed: " + completed)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myurischeme" android:host="open"/>
<data android:scheme="https" android:host="branchwebview.app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.app.link"/>
<data android:scheme="https" android:host="branchwebview.test-app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.test-app.link"/>
<data android:scheme="rntestbed" android:host="open"/>
<data android:scheme="https" android:host="5vwu.app.link"/>
<data android:scheme="https" android:host="5vwu-alternate.app.link"/>
<data android:scheme="https" android:host="5vwu.test-app.link"/>
<data android:scheme="https" android:host="5vwu-alternate.test-app.link"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
Expand All @@ -26,7 +26,7 @@
</intent-filter>
</receiver>
<!-- Branch keys -->
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_fnEOjLBXxU7teRvUn1xvpbbbryex8vcB"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_oiBNmHw3FQWznLFSe2rQxaogutkr3ymN"/>
</application>
</manifest>
1 change: 0 additions & 1 deletion examples/testbed_native_android/fastlane/Branchfile

This file was deleted.

26 changes: 26 additions & 0 deletions examples/testbed_native_android/fastlane/Branchfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Edit the configuration below.
# Change to any example project folder and run fastlane update_branch.

# bundle install
# cd webview_example
# bundle exec fastlane update_branch

# iOS projects: Also validate the Universal Link configuration with
# bundle exec fastlane validate

# -----

patch_source false
add_sdk false

# Branch configuration defaults

live_key "key_live_fnEOjLBXxU7teRvUn1xvpbbbryex8vcB"
test_key "key_test_oiBNmHw3FQWznLFSe2rQxaogutkr3ymN"
app_link_subdomain "5vwu"

# Use instead of app_link_subdomain for custom domains:
# domains %w{example.com www.example.com}

# Android only
uri_scheme "rntestbed"
1 change: 0 additions & 1 deletion examples/testbed_native_ios/fastlane/Branchfile

This file was deleted.

26 changes: 26 additions & 0 deletions examples/testbed_native_ios/fastlane/Branchfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Edit the configuration below.
# Change to any example project folder and run fastlane update_branch.

# bundle install
# cd webview_example
# bundle exec fastlane update_branch

# iOS projects: Also validate the Universal Link configuration with
# bundle exec fastlane validate

# -----

patch_source false
add_sdk false

# Branch configuration defaults

live_key "key_live_cirLbMAWuV4KWL4xiLvnMlfgxsbE1EV7"
test_key "key_test_cmvOfPDZAOWV4HXFaUrj7oncqFoq2CZi"
app_link_subdomain "7z2z"

# Use instead of app_link_subdomain for custom domains:
# domains %w{example.com www.example.com}

# Android only
# uri_scheme "rntestbed"
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = testbed_native_ios/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.testbed-native-ios";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Test-Release";
Expand Down Expand Up @@ -442,7 +442,7 @@
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = testbed_native_ios/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.testbed-native-ios";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Test-Debug";
Expand Down Expand Up @@ -561,7 +561,7 @@
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = testbed_native_ios/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.testbed-native-ios";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -576,7 +576,7 @@
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = testbed_native_ios/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.testbed-native-ios";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
4 changes: 2 additions & 2 deletions examples/testbed_native_ios/testbed_native_ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<key>branch_key</key>
<dict>
<key>live</key>
<string>key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S</string>
<string>key_live_cirLbMAWuV4KWL4xiLvnMlfgxsbE1EV7</string>
<key>test</key>
<string>key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9</string>
<string>key_test_cmvOfPDZAOWV4HXFaUrj7oncqFoq2CZi</string>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:branchwebview.app.link</string>
<string>applinks:branchwebview-alternate.app.link</string>
<string>applinks:branchwebview.test-app.link</string>
<string>applinks:branchwebview-alternate.test-app.link</string>
<string>applinks:7z2z.app.link</string>
<string>applinks:7z2z-alternate.app.link</string>
<string>applinks:7z2z.test-app.link</string>
<string>applinks:7z2z-alternate.test-app.link</string>
</array>
</dict>
</plist>
14 changes: 7 additions & 7 deletions examples/testbed_simple/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myurischeme" android:host="open"/>
<data android:scheme="https" android:host="branchwebview.app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.app.link"/>
<data android:scheme="https" android:host="branchwebview.test-app.link"/>
<data android:scheme="https" android:host="branchwebview-alternate.test-app.link"/>
<data android:scheme="rntestbed" android:host="open"/>
<data android:scheme="https" android:host="zjef.app.link"/>
<data android:scheme="https" android:host="zjef-alternate.app.link"/>
<data android:scheme="https" android:host="zjef.test-app.link"/>
<data android:scheme="https" android:host="zjef-alternate.test-app.link"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
Expand All @@ -27,7 +27,7 @@
</intent-filter>
</receiver>
<!-- Branch keys -->
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_jnFOgSy0CLIEbPhiS980ccdoxznE8aou"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_epyPpLw3zPQqdHklHXY5jfmkAyat5cbm"/>
</application>
</manifest>
1 change: 0 additions & 1 deletion examples/testbed_simple/fastlane/Branchfile

This file was deleted.

Loading

0 comments on commit c5fba7f

Please sign in to comment.