You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the app is launched with a uri and ACTION_MAIN, the appUrlOpen listener is NOT called.
If the app is launched the same way but with ACTION_VIEW then the appUrlOpen listener IS called.
Expected Behavior
The appUrlOpen listener should be called as long as there is some data uri ... even if the action is ACTION_MAIN.
The code currently checks both the uri and action and only continues if the action is set to ACTION_VIEW.
I'm not sure exactly what should be checked here ... but ideally, this listener should also be called if the app is launched with ACTION_MAIN.
With the Cordova com.lampa.startapp plugin, by default, when you launch another application, the intent will have ACTION_MAIN. When using the Cordova Custom-URL-scheme plugin in the launched app, this would call the app's handleOpenURL method. I would like to convert the launched app to Capacitor and use the Capacitor App plugin instead of the Cordova Custom-URL-scheme plugin. However, this doesn't work ... because the Capacitor plugin does not call the appUrlOpen listener when the app is launched with ACTION_MAIN. Unfortunately, it is not practical to change all of the apps that launch this app to always launch with ACTION_MAIN.
Code Reproduction
Other Technical Details
Additional Context
A simple fix for this would be to remove the check for ACTION_VIEW in the handleOnNewIntent method in App.java (or at least add a check for ACTION_MAIN as well as ACTION_VIEW
A workaround for this issue is to use the plugin cordova-plugin-customurlscheme in your capacitor app. See also: EddyVerbruggen/Custom-URL-scheme#332
The text was updated successfully, but these errors were encountered:
Bug Report
Plugin(s)
Core App plugin on Android, Capacitor 2.4.3
Capacitor Version
Platform(s)
Android
Current Behavior
When the app is launched with a uri and ACTION_MAIN, the appUrlOpen listener is NOT called.
If the app is launched the same way but with ACTION_VIEW then the appUrlOpen listener IS called.
Expected Behavior
The appUrlOpen listener should be called as long as there is some data uri ... even if the action is ACTION_MAIN.
The code currently checks both the uri and action and only continues if the action is set to ACTION_VIEW.
I'm not sure exactly what should be checked here ... but ideally, this listener should also be called if the app is launched with ACTION_MAIN.
With the Cordova com.lampa.startapp plugin, by default, when you launch another application, the intent will have ACTION_MAIN. When using the Cordova Custom-URL-scheme plugin in the launched app, this would call the app's handleOpenURL method. I would like to convert the launched app to Capacitor and use the Capacitor App plugin instead of the Cordova Custom-URL-scheme plugin. However, this doesn't work ... because the Capacitor plugin does not call the appUrlOpen listener when the app is launched with ACTION_MAIN. Unfortunately, it is not practical to change all of the apps that launch this app to always launch with ACTION_MAIN.
Code Reproduction
Other Technical Details
Additional Context
A simple fix for this would be to remove the check for ACTION_VIEW in the handleOnNewIntent method in App.java (or at least add a check for ACTION_MAIN as well as ACTION_VIEW
A workaround for this issue is to use the plugin cordova-plugin-customurlscheme in your capacitor app. See also: EddyVerbruggen/Custom-URL-scheme#332
The text was updated successfully, but these errors were encountered: