Skip to content

Commit c5fba7f

Browse files
authored
Merge pull request #275 from BranchMetrics/example-app-branch-ids
Example app Branch IDs
2 parents 4f5c539 + 7c6ed94 commit c5fba7f

File tree

29 files changed

+231
-144
lines changed

29 files changed

+231
-144
lines changed

examples/Branchfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Once this is done, you can deploy the app on a device and open Universal Links i
2727

2828
To use this tool:
2929

30-
1. Edit the [Branchfile](./Branchfile) in this directory to use the correct parameters for your app from the
31-
Branch Dashboard.
30+
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)
3231
2. To update any example app, e.g. `webview_example`:
3332
```bash
3433
bundle install

examples/browser_example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ deep links rather than a web redirect. It accomplishes this using the
55
`branch.openURL` method.
66

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

1111
## Building
1212

examples/browser_example/android/app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<category android:name="android.intent.category.DEFAULT"/>
1414
<category android:name="android.intent.category.BROWSABLE"/>
1515
<data android:scheme="myurischeme" android:host="open"/>
16-
<data android:scheme="https" android:host="branchwebview.app.link"/>
17-
<data android:scheme="https" android:host="branchwebview-alternate.app.link"/>
18-
<data android:scheme="https" android:host="branchwebview.test-app.link"/>
19-
<data android:scheme="https" android:host="branchwebview-alternate.test-app.link"/>
16+
<data android:scheme="https" android:host="b8e9.app.link"/>
17+
<data android:scheme="https" android:host="b8e9-alternate.app.link"/>
18+
<data android:scheme="https" android:host="b8e9.test-app.link"/>
19+
<data android:scheme="https" android:host="b8e9-alternate.test-app.link"/>
2020
</intent-filter>
2121
</activity>
2222
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
23-
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S"/>
24-
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9"/>
23+
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN"/>
24+
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ"/>
2525
</application>
2626
</manifest>

examples/browser_example/fastlane/Branchfile

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Edit the configuration below.
2+
# Change to any example project folder and run fastlane update_branch.
3+
4+
# bundle install
5+
# cd webview_example
6+
# bundle exec fastlane update_branch
7+
8+
# iOS projects: Also validate the Universal Link configuration with
9+
# bundle exec fastlane validate
10+
11+
# -----
12+
13+
patch_source false
14+
add_sdk false
15+
16+
# Branch configuration defaults
17+
18+
live_key "key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN"
19+
test_key "key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ"
20+
app_link_subdomain "b8e9"
21+
22+
# Use instead of app_link_subdomain for custom domains:
23+
# domains %w{example.com www.example.com}
24+
25+
# Android only
26+
uri_scheme "myurischeme"

examples/browser_example/ios/browser_example.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@
11881188
"-ObjC",
11891189
"-lc++",
11901190
);
1191-
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
1191+
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.browser-example";
11921192
PRODUCT_NAME = browser_example;
11931193
VERSIONING_SYSTEM = "apple-generic";
11941194
};
@@ -1212,7 +1212,7 @@
12121212
"-ObjC",
12131213
"-lc++",
12141214
);
1215-
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.WebViewExample;
1215+
PRODUCT_BUNDLE_IDENTIFIER = "io.branch.react.browser-example";
12161216
PRODUCT_NAME = browser_example;
12171217
VERSIONING_SYSTEM = "apple-generic";
12181218
};

examples/browser_example/ios/browser_example/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
<key>branch_key</key>
5555
<dict>
5656
<key>live</key>
57-
<string>key_live_dczvWn3zrK8575YRe07IgjblAAmfx51S</string>
57+
<string>key_live_onzHkTB1E4aeo2HI8qsnFmfaBupEXGtN</string>
5858
<key>test</key>
59-
<string>key_test_fbqC9k2BqS68Y1XQi7YVjakhCxomD6Z9</string>
59+
<string>key_test_bjBRbHrWF9hfo5KH5EEhEpogCwfv2UrZ</string>
6060
</dict>
6161
</dict>
6262
</plist>

examples/browser_example/ios/browser_example/browser_example.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<dict>
55
<key>com.apple.developer.associated-domains</key>
66
<array>
7-
<string>applinks:branchwebview.app.link</string>
8-
<string>applinks:branchwebview-alternate.app.link</string>
9-
<string>applinks:branchwebview.test-app.link</string>
10-
<string>applinks:branchwebview-alternate.test-app.link</string>
7+
<string>applinks:b8e9.app.link</string>
8+
<string>applinks:b8e9-alternate.app.link</string>
9+
<string>applinks:b8e9.test-app.link</string>
10+
<string>applinks:b8e9-alternate.test-app.link</string>
1111
</array>
1212
</dict>
1313
</plist>

examples/browser_example/src/App.js

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react'
2-
import { StyleSheet, Text, TextInput, TouchableHighlight, View, WebView } from 'react-native'
2+
import { StyleSheet, Text, TextInput, View, WebView } from 'react-native'
33

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

@@ -15,13 +15,6 @@ const styles = StyleSheet.create({
1515
webView: {
1616
flex: 0.77
1717
},
18-
button: {
19-
backgroundColor: '#cceeee',
20-
borderColor: '#2266aa',
21-
borderTopWidth: 1,
22-
flex: 0.15,
23-
justifyContent: 'center'
24-
},
2518
buttonText: {
2619
color: '#2266aa',
2720
fontSize: 23,
@@ -85,14 +78,6 @@ export default class App extends Component {
8578
style={styles.webView}
8679
source={{uri: this.state.url}}
8780
onLoad={this.registerView.bind(this)} />
88-
<TouchableHighlight
89-
onPress={() => this.onShare()}
90-
style={styles.button} >
91-
<Text
92-
style={styles.buttonText}>
93-
Share
94-
</Text>
95-
</TouchableHighlight>
9681
</View>
9782
)
9883
}
@@ -114,25 +99,4 @@ export default class App extends Component {
11499
this.buo.userCompletedAction(RegisterViewEvent)
115100
console.log("Created Branch Universal Object and logged RegisterViewEvent.")
116101
}
117-
118-
async onShare() {
119-
let { channel, completed, error } = await this.buo.showShareSheet({
120-
emailSubject: "The Planet " + this.props.route.title,
121-
messageBody: "Read about the planet " + this.props.route.title + ".",
122-
messageHeader: "The Planet " + this.props.route.title
123-
}, {
124-
feature: "share",
125-
channel: "RNApp"
126-
}, {
127-
$desktop_url: this.props.route.url,
128-
$ios_deepview: "branch_default"
129-
})
130-
131-
if (error) {
132-
console.error("Error sharing via Branch: " + error)
133-
return
134-
}
135-
136-
console.log("Share to " + channel + " completed: " + completed)
137-
}
138102
}

0 commit comments

Comments
 (0)