1111
1212import android .util .Log ;
1313
14+ import java .util .Arrays ;
1415import java .util .List ;
1516
1617class 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
0 commit comments