Skip to content

Commit

Permalink
Update Dynamic Links sample for custom subdomains (firebase#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthecheung authored and samtstern committed Jun 7, 2018
1 parent da5e1c8 commit 6c6fc76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dynamiclinks/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ android {
main {
dimension "all"

// TODO(developer): Replace this with your app code
// TODO(developer): Replace this with your Dynamic Links domain
// See: https://firebase.google.com/docs/dynamic-links/android/create#set-up-firebase-and-the-dynamic-links-sdk
resValue "string", "app_code", "YOUR_APP_CODE"
resValue "string", "dynamic_links_domain", "YOUR_APP.page.link"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onFailure(@NonNull Exception e) {
*/
@VisibleForTesting
public Uri buildDeepLink(@NonNull Uri deepLink, int minVersion) {
String domain = getString(R.string.app_code) + ".app.goo.gl";
String domain = getString(R.string.dynamic_links_domain);

// Set dynamic link parameters:
// * Domain (required)
Expand Down Expand Up @@ -151,11 +151,11 @@ private void shareDeepLink(String deepLink) {
}

private void validateAppCode() {
String appCode = getString(R.string.app_code);
if (appCode.contains("YOUR_APP_CODE")) {
String domain = getString(R.string.dynamic_links_domain);
if (domain.contains("YOUR_APP")) {
new AlertDialog.Builder(this)
.setTitle("Invalid Configuration")
.setMessage("Please set your app code in app/build.gradle")
.setMessage("Please set your Dynamic Links domain in app/build.gradle")
.setPositiveButton(android.R.string.ok, null)
.create().show();
}
Expand Down
6 changes: 3 additions & 3 deletions dynamiclinks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

buildscript {
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
Expand All @@ -19,8 +19,8 @@ allprojects {
repositories {
//mavenLocal() must be listed at the top to facilitate testing
mavenLocal()
google()
jcenter()
maven { url 'https://maven.google.com' }
}
}

Expand Down

0 comments on commit 6c6fc76

Please sign in to comment.