Skip to content

Commit

Permalink
Cleanup (#919)
Browse files Browse the repository at this point in the history
* remove IntentKeys.AndroidPushNotificationKey which was not used anywhere (and would have clashed with BranchURI too)

* define AutoDeepLinked intentkey
  • Loading branch information
bklastaitis-branch authored Jun 30, 2021
1 parent 3b4fc98 commit a6bfb33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 2 additions & 5 deletions Branch-SDK/src/main/java/io/branch/referral/Branch.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ enum INTENT_STATE {
/* The current activity instance for the application.*/
WeakReference<Activity> currentActivityReference_;

/* Key to indicate whether the Activity was launched by Branch or not. */
private static final String AUTO_DEEP_LINKED = "io.branch.sdk.auto_linked";

/* Key for Auto Deep link param. The activities which need to automatically deep linked should define in this in the activity metadata. */
private static final String AUTO_DEEP_LINK_KEY = "io.branch.sdk.auto_link_keys";

Expand Down Expand Up @@ -2253,7 +2250,7 @@ private class GetShortLinkTask extends AsyncTask<ServerRequest, Void, ServerResp
* @return A {Boolean} value whose value is true if this activity is launched by Branch auto deeplink feature.
*/
public static boolean isAutoDeepLinkLaunch(Activity activity) {
return (activity.getIntent().getStringExtra(AUTO_DEEP_LINKED) != null);
return (activity.getIntent().getStringExtra(Defines.IntentKeys.AutoDeepLinked.getKey()) != null);
}

void checkForAutoDeepLinkConfiguration() {
Expand Down Expand Up @@ -2291,7 +2288,7 @@ void checkForAutoDeepLinkConfiguration() {
Activity currentActivity = getCurrentActivity();

Intent intent = new Intent(currentActivity, Class.forName(deepLinkActivity));
intent.putExtra(AUTO_DEEP_LINKED, "true");
intent.putExtra(Defines.IntentKeys.AutoDeepLinked.getKey(), "true");

// Put the raw JSON params as extra in case need to get the deep link params as JSON String
intent.putExtra(Defines.Jsonkey.ReferringData.getKey(), latestParams.toString());
Expand Down
6 changes: 4 additions & 2 deletions Branch-SDK/src/main/java/io/branch/referral/Defines.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,12 @@ public String toString() {
*/
public enum IntentKeys {
BranchData("branch_data"),
AndroidPushNotificationKey("branch"),
ForceNewBranchSession("branch_force_new_session"),
BranchLinkUsed("branch_used"),
BranchURI("branch");
BranchURI("branch"),

/* Key to indicate whether the Activity was launched by Branch or not. */
AutoDeepLinked("io.branch.sdk.auto_linked");

private final String key;

Expand Down

0 comments on commit a6bfb33

Please sign in to comment.