File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " deep-link " : patch
3+ " deep-link-js " : patch
4+ ---
5+
6+ Account for differing Android VIEW intent in ChromeOS, fixing deep-link behaviour on Chromium platforms.
Original file line number Diff line number Diff line change @@ -44,11 +44,14 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
4444 private var currentUrl: String? = null
4545 private var channel: Channel ? = null
4646 private var config: PluginConfig ? = null
47-
4847 companion object {
4948 var instance: DeepLinkPlugin ? = null
5049 }
5150
51+ private fun isViewIntent (action : String? ): Boolean {
52+ return action == Intent .ACTION_VIEW || action == " org.chromium.arc.intent.action.VIEW"
53+ }
54+
5255 @Command
5356 fun getCurrent (invoke : Invoke ) {
5457 val ret = JSObject ()
@@ -74,7 +77,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
7477
7578 val intent = activity.intent
7679
77- if (intent.action == Intent . ACTION_VIEW && intent.data != null ) {
80+ if (isViewIntent( intent.action) && intent.data != null ) {
7881 val url = intent.data.toString()
7982 if (isDeepLink(url)) {
8083 // TODO: check if it makes sense to split up init url and last url
@@ -87,7 +90,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
8790 }
8891
8992 override fun onNewIntent (intent : Intent ) {
90- if (intent.action == Intent . ACTION_VIEW && intent.data != null ) {
93+ if (isViewIntent( intent.action) && intent.data != null ) {
9194 val url = intent.data.toString()
9295 if (isDeepLink(url)) {
9396 this .currentUrl = url
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
2525 format ! (
2626 r#"<intent-filter {auto_verify}>
2727 <action android:name="android.intent.action.VIEW" />
28+ <!-- ChromeOS ARC++ uses a different action for deep links -->
29+ <action android:name="org.chromium.arc.intent.action.VIEW" />
2830 <category android:name="android.intent.category.DEFAULT" />
2931 <category android:name="android.intent.category.BROWSABLE" />
3032 {schemes}
You can’t perform that action at this time.
0 commit comments