Skip to content

Commit d980fce

Browse files
committed
Patch 1
1 parent 6109022 commit d980fce

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableActionRunner.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
import android.util.Log;
1313

14+
import java.util.Arrays;
1415
import java.util.List;
1516

1617
class IterableActionRunner {
1718
@VisibleForTesting
1819
static IterableActionRunnerImpl instance = new IterableActionRunnerImpl();
1920

2021
static boolean executeAction(@NonNull Context context, @Nullable IterableAction action, @NonNull IterableActionSource source) {
21-
return instance.executeAction(context, action, source, new String[0]);
22+
return instance.executeAction(context, action, source, IterableApi.getInstance().config.allowedProtocols);
2223
}
2324

2425
static boolean executeAction(@NonNull Context context, @Nullable IterableAction action, @NonNull IterableActionSource source, @NonNull String[] allowedProtocols) {
@@ -29,7 +30,7 @@ static class IterableActionRunnerImpl {
2930
private static final String TAG = "IterableActionRunner";
3031

3132
boolean executeAction(@NonNull Context context, @Nullable IterableAction action, @NonNull IterableActionSource source) {
32-
return executeAction(context, action, source, new String[0]);
33+
return executeAction(context, action, source, IterableApi.getInstance().config.allowedProtocols);
3334
}
3435

3536
/**
@@ -66,18 +67,18 @@ boolean executeAction(@NonNull Context context, @Nullable IterableAction action,
6667
* `false` if the handler did not handle this URL and no activity was found to open it with
6768
*/
6869
private boolean openUri(@NonNull Context context, @NonNull Uri uri, @NonNull IterableActionContext actionContext, String[] allowedProtocols) {
69-
if (IterableApi.sharedInstance.config.urlHandler != null) {
70-
if (IterableApi.sharedInstance.config.urlHandler.handleIterableURL(uri, actionContext)) {
71-
return true;
72-
}
73-
}
74-
7570
// Handle URL: check for deep links within the app
7671
if (!isUrlOpenAllowed(uri.toString(), allowedProtocols)) {
7772
IterableLogger.e(TAG, "URL was not in the allowed protocols list");
7873
return false;
7974
}
8075

76+
if (IterableApi.sharedInstance.config.urlHandler != null) {
77+
if (IterableApi.sharedInstance.config.urlHandler.handleIterableURL(uri, actionContext)) {
78+
return true;
79+
}
80+
}
81+
8182
Intent intent = new Intent(Intent.ACTION_VIEW);
8283
intent.setData(uri);
8384

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ public void execute(String originalUrl) {
427427
IterableAction action = IterableAction.actionOpenUrl(originalUrl);
428428
IterableActionRunner.executeAction(getInstance().getMainActivityContext(), action, IterableActionSource.APP_LINK);
429429
}
430-
}, config.allowedProtocols);
430+
}, sharedInstance.config.allowedProtocols);
431431
return true;
432432
} else {
433433
IterableAction action = IterableAction.actionOpenUrl(uri);

0 commit comments

Comments
 (0)