Skip to content

Commit c7f6f20

Browse files
obrand69ThexXTURBOXx
authored andcommitted
Default to chrome at the end (#125)
1 parent 73f9189 commit c7f6f20

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

flutter_web_auth_2/android/src/main/kotlin/com/linusu/flutter_web_auth_2/FlutterWebAuth2Plugin.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ class FlutterWebAuth2Plugin(
8282
*/
8383
private fun findTargetBrowserPackageName(options: Map<String, Any>): String? {
8484
val chromePackage = "com.android.chrome"
85-
//if installed chrome, use chrome at first
86-
if (isSupportCustomTabs(chromePackage)) {
87-
return chromePackage
88-
}
8985

9086
@Suppress("UNCHECKED_CAST")
9187
val customTabsPackageOrder = (options["customTabsPackageOrder"] as Iterable<String>?) ?: emptyList()
@@ -104,6 +100,9 @@ class FlutterWebAuth2Plugin(
104100
val allBrowsers = getInstalledBrowsers()
105101
targetPackage = allBrowsers.firstOrNull { isSupportCustomTabs(it) }
106102

103+
if (targetPackage == null) {
104+
targetPackage = chromePackage
105+
}
107106
return targetPackage
108107
}
109108

0 commit comments

Comments
 (0)