Skip to content

Commit

Permalink
Refactors based on Gabe's PR feedback (2/2)
Browse files Browse the repository at this point in the history
Refactors based on Gabe's PR feedback (2/2)
  • Loading branch information
rob-gioia-branch committed Nov 26, 2024
1 parent ce0517d commit 97d42f7
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.alternateDomainsMoreInfoDocsLink;

import android.content.Context;
import android.text.TextUtils;

Expand All @@ -8,7 +10,7 @@
public class AlternateDomainsCheck extends IntegrationValidatorCheck {
String name = "Alt Domains";
String errorMessage = "Could not find intent filter to support alternate link domain. Please add intent filter for handling alternate link domain in your Android Manifest file";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=The%20%2Dalternate.app.link%20domain%20associated%20with%20your%20app\">More info</a>";
String moreInfoLink = alternateDomainsMoreInfoDocsLink;
BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.appLinksMoreInfoDocsLink;

import android.content.Context;
import android.text.TextUtils;

Expand All @@ -9,7 +11,7 @@ public class AppLinksCheck extends IntegrationValidatorCheck {

String name = "App Links";
String errorMessage = "Could not find any App Link hosts to support Android AppLinks. Please add intent filter for handling AppLinks in your Android Manifest file";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=%3C!%2D%2D%20Branch%20App%20Links%20%2D%20Live,%3C/intent%2Dfilter%3E\">More info</a>";
String moreInfoLink = appLinksMoreInfoDocsLink;
BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.branchInstanceCreationMoreInfoDocsLink;

import android.content.Context;

import io.branch.referral.Branch;
Expand All @@ -8,7 +10,7 @@ public class BranchInstanceCreationValidatorCheck extends IntegrationValidatorCh

String name = "Branch instance";
String errorMessage = "Branch is not initialised from your Application class. Please add `Branch.getAutoInstance(this);` to your Application#onCreate() method.";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=Branch.getAutoInstance(this)\">More info</a>";
String moreInfoLink = branchInstanceCreationMoreInfoDocsLink;

public BranchInstanceCreationValidatorCheck() {
super.name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.branchKeysMoreInfoDocsLink;

import android.content.Context;
import android.text.TextUtils;

Expand All @@ -9,7 +11,7 @@ public class BranchKeysValidatorCheck extends IntegrationValidatorCheck {

String name = "Branch Keys";
String errorMessage = "Unable to read Branch keys from your application. Did you forget to add Branch keys in your application?.";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=%3C!%2D%2D%20REPLACE%20%60BranchKey%60%20with,%22key_test_XXX%22%20/%3E\">More info</a>";
String moreInfoLink = branchKeysMoreInfoDocsLink;

public BranchKeysValidatorCheck() {
super.name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.customDomainMoreInfoDocsLink;

import android.content.Context;
import android.text.TextUtils;

Expand All @@ -9,7 +11,7 @@ public class CustomDomainCheck extends IntegrationValidatorCheck {

String name = "Custom Domain";
String errorMessage = "Could not find intent filter to support Branch default link domain. Please add intent filter for handling custom link domain in your Android Manifest file";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#section-configure-app\">More info</a>";
String moreInfoLink = customDomainMoreInfoDocsLink;
BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.defaultDomainsMoreInfoDocsLink;

import android.content.Context;
import android.text.TextUtils;

Expand All @@ -9,7 +11,7 @@ public class DefaultDomainsCheck extends IntegrationValidatorCheck {

String name = "Default Domains";
String errorMessage = "Could not find any App Link hosts to support Android AppLinks. Please add intent filter for handling AppLinks in your Android Manifest file";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app:~:text=%3C!%2D%2D%20Branch%20App%20Links%20%2D%20Live,%3C/intent%2Dfilter%3E\">More info</a>";
String moreInfoLink = defaultDomainsMoreInfoDocsLink;
BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
public class IntegrationValidatorConstants {
public static final String checkmark = "✅";
public static final String xmark = "❌";
public static final String appLinksMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=%3C!%2D%2D%20Branch%20App%20Links%20%2D%20Live,%3C/intent%2Dfilter%3E\">More info</a>";
public static final String alternateDomainsMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=The%20%2Dalternate.app.link%20domain%20associated%20with%20your%20app\">More info</a>";
public static final String branchInstanceCreationMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=Branch.getAutoInstance(this)\">More info</a>";
public static final String branchKeysMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=%3C!%2D%2D%20REPLACE%20%60BranchKey%60%20with,%22key_test_XXX%22%20/%3E\">More info</a>";
public static final String customDomainMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#section-configure-app\">More info</a>";
public static final String defaultDomainsMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app:~:text=%3C!%2D%2D%20Branch%20App%20Links%20%2D%20Live,%3C/intent%2Dfilter%3E\">More info</a>";
public static final String packageNameMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=package%3D%22com.example.android%22\">More info</a>";
public static final String uriSchemeAppMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app:~:text=%3Cintent%2Dfilter%3E%0A%09%09%09%09%3C!%2D%2D%20If,/%3E%0A%09%09%09%3C/intent%2Dfilter%3E\">More info</a>";
public static final String uriSchemeDashboardMoreInfoDocsLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#1-configure-branch-dashboard:~:text=%22Android%20URI%20Scheme%22\">More info</a>";
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.packageNameMoreInfoDocsLink;

import android.content.Context;

import org.json.JSONObject;
Expand All @@ -8,7 +10,7 @@ public class PackageNameCheck extends IntegrationValidatorCheck {

String name = "Package Name";
String errorMessage = "Incorrect package name in Branch dashboard. Please correct your package name in dashboard -> Configuration page.";
String moreInfoLink = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#:~:text=package%3D%22com.example.android%22\">More info</a>";
String moreInfoLink = packageNameMoreInfoDocsLink;
BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.branch.referral.validators;

import static io.branch.referral.validators.IntegrationValidatorConstants.uriSchemeAppMoreInfoDocsLink;
import static io.branch.referral.validators.IntegrationValidatorConstants.uriSchemeDashboardMoreInfoDocsLink;

import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
Expand All @@ -17,8 +20,8 @@ public class URISchemeCheck extends IntegrationValidatorCheck {
String uriSchemeNotSetInBranchDashboardErrorMessage = "Uri Scheme to open your app is not specified in Branch dashboard. Please add URI scheme in Branch dashboard.";
String uriSchemesDoNotMatchErrorMessage = "Uri scheme specified in Branch dashboard doesn't match with the deep link intent in manifest file.";

String moreInfoLinkApp = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app:~:text=%3Cintent%2Dfilter%3E%0A%09%09%09%09%3C!%2D%2D%20If,/%3E%0A%09%09%09%3C/intent%2Dfilter%3E\">More info</a>";
String moreInfoLinkDashboard = "<a href=\"https://help.branch.io/developers-hub/docs/android-basic-integration#1-configure-branch-dashboard:~:text=%22Android%20URI%20Scheme%22\">More info</a>";
String moreInfoLinkApp = uriSchemeAppMoreInfoDocsLink;
String moreInfoLinkDashboard = uriSchemeDashboardMoreInfoDocsLink;

BranchIntegrationModel integrationModel;
JSONObject branchAppConfig;
Expand Down

0 comments on commit 97d42f7

Please sign in to comment.