-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a popup dialog displaying the Integration Validator results with options to view more details and export the logs Added a popup dialog displaying the Integration Validator results with options to view more details and export the logs * Got deep link validator dialog showing Got deep link validator dialog showing * Added spinner with the different choices of deep link keys used for routing Added spinner with the different choices of deep link keys used for routing * Next button loads the correct content for step 2 based on the user's choice Next button loads the correct content for step 2 based on the user's choice * Removed unneeded permissions Removed unneeded permissions * Used IBranchLoggingCallbacks to retrieve the Branch logs Used IBranchLoggingCallbacks to retrieve the Branch logs * Added code to generate the various types of Branch links for testing Added code to generate the various types of Branch links for testing * Laid out the UI for step 3 of the modal (link & use case testing) Laid out the UI for step 3 of the modal (link & use case testing) * Added constants and built out a deep link validator row class to encapsulate each row Added constants and built out a deep link validator row class to encapsulate each row * Got the info buttons showing the relevant tooltips Got the info buttons showing the relevant tooltips * Added share button functionality Added share button functionality * Added debug button functionality to show popup with how to fix deep link issue Added debug button functionality to show popup with how to fix deep link issue * Logic refactors so that each row uses uniform, modular code vs. hardcoded specifics Logic refactors so that each row uses uniform, modular code vs. hardcoded specifics * Added foreground click use case Added foreground click use case * Added warm start test case logic + some bugfixes Added warm start test case logic + some bugfixes * Params bugfixes Params bugfixes * Merged the Deep Linking Validator and the Integration Validator. Merged the Deep Linking Validator and the Integration Validator. * Refactors based on Gabe's PR feedback (1 of 2) Refactors based on Gabe's PR feedback (1 of 2) * Refactors based on Gabe's PR feedback (2/2) Refactors based on Gabe's PR feedback (2/2)
- Loading branch information
1 parent
10f9960
commit 0ab54c5
Showing
24 changed files
with
1,630 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Branch-SDK/src/main/java/io/branch/referral/validators/AlternateDomainsCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.alternateDomainsMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import org.json.JSONObject; | ||
|
||
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 = alternateDomainsMoreInfoDocsLink; | ||
BranchIntegrationModel integrationModel; | ||
JSONObject branchAppConfig; | ||
|
||
public AlternateDomainsCheck(BranchIntegrationModel integrationModel, JSONObject branchAppConfig) { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
this.integrationModel = integrationModel; | ||
this.branchAppConfig = branchAppConfig; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
String alternateAppLinkDomain = branchAppConfig.optString("alternate_short_url_domain"); | ||
return TextUtils.isEmpty(alternateAppLinkDomain) || checkIfIntentAddedForLinkDomain(alternateAppLinkDomain); | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
|
||
private boolean checkIfIntentAddedForLinkDomain(String domainName) { | ||
boolean foundIntentFilterMatchingDomainName = false; | ||
if (!TextUtils.isEmpty(domainName)) { | ||
for (String host : integrationModel.applinkScheme) { | ||
if (domainName.equals(host)) { | ||
foundIntentFilterMatchingDomainName = true; | ||
break; | ||
} | ||
} | ||
} | ||
return foundIntentFilterMatchingDomainName; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Branch-SDK/src/main/java/io/branch/referral/validators/AppLinksCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.appLinksMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import org.json.JSONObject; | ||
|
||
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 = appLinksMoreInfoDocsLink; | ||
BranchIntegrationModel integrationModel; | ||
JSONObject branchAppConfig; | ||
|
||
public AppLinksCheck(BranchIntegrationModel integrationModel, JSONObject branchAppConfig) { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
this.integrationModel = integrationModel; | ||
this.branchAppConfig = branchAppConfig; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
String defAppLinkDomain = branchAppConfig.optString("default_short_url_domain"); | ||
return !integrationModel.applinkScheme.isEmpty() && !TextUtils.isEmpty(defAppLinkDomain) && checkIfIntentAddedForLinkDomain(defAppLinkDomain); | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
|
||
private boolean checkIfIntentAddedForLinkDomain(String domainName) { | ||
boolean foundIntentFilterMatchingDomainName = false; | ||
if (!TextUtils.isEmpty(domainName) && integrationModel.applinkScheme != null) { | ||
for (String host : integrationModel.applinkScheme) { | ||
if (domainName.equals(host)) { | ||
foundIntentFilterMatchingDomainName = true; | ||
break; | ||
} | ||
} | ||
} | ||
return foundIntentFilterMatchingDomainName; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...SDK/src/main/java/io/branch/referral/validators/BranchInstanceCreationValidatorCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.branchInstanceCreationMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
|
||
import io.branch.referral.Branch; | ||
|
||
public class BranchInstanceCreationValidatorCheck extends IntegrationValidatorCheck { | ||
|
||
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 = branchInstanceCreationMoreInfoDocsLink; | ||
|
||
public BranchInstanceCreationValidatorCheck() { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
return Branch.getInstance() != null; | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
|
||
@Override | ||
public String GetMoreInfoLink() { | ||
return moreInfoLink; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Branch-SDK/src/main/java/io/branch/referral/validators/BranchKeysValidatorCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.branchKeysMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import io.branch.referral.BranchUtil; | ||
|
||
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 = branchKeysMoreInfoDocsLink; | ||
|
||
public BranchKeysValidatorCheck() { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
return !TextUtils.isEmpty(BranchUtil.readBranchKey(context)); | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Branch-SDK/src/main/java/io/branch/referral/validators/CustomDomainCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.customDomainMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import org.json.JSONObject; | ||
|
||
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 = customDomainMoreInfoDocsLink; | ||
BranchIntegrationModel integrationModel; | ||
JSONObject branchAppConfig; | ||
|
||
public CustomDomainCheck(BranchIntegrationModel integrationModel, JSONObject branchAppConfig) { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
this.integrationModel = integrationModel; | ||
this.branchAppConfig = branchAppConfig; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
String customDomain = branchAppConfig.optString("short_url_domain"); | ||
return TextUtils.isEmpty(customDomain) || checkIfIntentAddedForLinkDomain(customDomain); | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
|
||
private boolean checkIfIntentAddedForLinkDomain(String domainName) { | ||
boolean foundIntentFilterMatchingDomainName = false; | ||
if (!TextUtils.isEmpty(domainName)) { | ||
for (String host : integrationModel.applinkScheme) { | ||
if (domainName.equals(host)) { | ||
foundIntentFilterMatchingDomainName = true; | ||
break; | ||
} | ||
} | ||
} | ||
return foundIntentFilterMatchingDomainName; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Branch-SDK/src/main/java/io/branch/referral/validators/DefaultDomainsCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.branch.referral.validators; | ||
|
||
import static io.branch.referral.validators.IntegrationValidatorConstants.defaultDomainsMoreInfoDocsLink; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import org.json.JSONObject; | ||
|
||
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 = defaultDomainsMoreInfoDocsLink; | ||
BranchIntegrationModel integrationModel; | ||
JSONObject branchAppConfig; | ||
|
||
public DefaultDomainsCheck(BranchIntegrationModel integrationModel, JSONObject branchAppConfig) { | ||
super.name = name; | ||
super.errorMessage = errorMessage; | ||
super.moreInfoLink = moreInfoLink; | ||
this.integrationModel = integrationModel; | ||
this.branchAppConfig = branchAppConfig; | ||
} | ||
|
||
@Override | ||
public boolean RunTests(Context context) { | ||
String defAppLinkDomain = branchAppConfig.optString("default_short_url_domain"); | ||
return TextUtils.isEmpty(defAppLinkDomain) || checkIfIntentAddedForLinkDomain(defAppLinkDomain); | ||
} | ||
|
||
@Override | ||
public String GetOutput(Context context, boolean didTestSucceed) { | ||
didTestSucceed = RunTests(context); | ||
return super.GetOutput(context, didTestSucceed); | ||
} | ||
|
||
private boolean checkIfIntentAddedForLinkDomain(String domainName) { | ||
boolean foundIntentFilterMatchingDomainName = false; | ||
if (!TextUtils.isEmpty(domainName)) { | ||
for (String host : integrationModel.applinkScheme) { | ||
if (domainName.equals(host)) { | ||
foundIntentFilterMatchingDomainName = true; | ||
break; | ||
} | ||
} | ||
} | ||
return foundIntentFilterMatchingDomainName; | ||
} | ||
} |
Oops, something went wrong.