Skip to content

Commit c9bfabd

Browse files
committed
filter banks instead of browsers
1 parent 83467a9 commit c9bfabd

File tree

1 file changed

+5
-9
lines changed
  • rampinstantsdk/src/main/java/network/ramp/instantsdk/ui/bank

1 file changed

+5
-9
lines changed

rampinstantsdk/src/main/java/network/ramp/instantsdk/ui/bank/BankActivity.kt

+5-9
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,8 @@ internal class BankActivity : AppCompatActivity() {
8585
companion object {
8686
const val FINISH_RECEIVER = "finish_activity"
8787
const val INTENT_URL = "url"
88-
val BROWSER_PACKAGE_NAMES = arrayOf(
89-
"com.android.chrome",
90-
"org.mozilla.firefox",
91-
"com.UCMobile.intl",
92-
"com.sec.android.app.sbrowser",
93-
"com.opera.browser",
94-
"com.opera.mini.native",
95-
"com.microsoft.emmx"
88+
val BANK_HOST_NAMES = arrayOf(
89+
"verify.monzo.com"
9690
)
9791
const val ACTION_VIEW_INTENT = "android.intent.action.VIEW"
9892
}
@@ -107,11 +101,13 @@ internal class BankActivity : AppCompatActivity() {
107101
val intent = Intent(ACTION_VIEW_INTENT)
108102
intent.data = Uri.parse(destinationUrl)
109103
val activity = intent.resolveActivity(context.packageManager)
110-
if (activity != null && !BROWSER_PACKAGE_NAMES.contains(activity.packageName)) {
104+
Timber.d("PACKAGE: ${activity.packageName}")
105+
if (activity != null && BANK_HOST_NAMES.contains(intent.data?.host ?: "no host")) {
111106
context.startActivity(intent)
112107
isAppOpened = true
113108
}
114109
} catch (ignore: Exception) {
110+
Timber.d(ignore)
115111
}
116112
if (!isAppOpened) {
117113
Timber.d("isAppOpened : $isAppOpened Load url $destinationUrl")

0 commit comments

Comments
 (0)