apache / apache/cordova-plugin-inappbrowser
Ability to open another app in a new task instead of on top of the exisiting task (using _system)
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
# Feature Request
## Motivation Behind Feature
Invoking locally installed app in any launch mode based on the app thats getting invoked.
## Feature Description
There should be a plugin level config to open another app from current app in different launch mode. We can currently do that by specifying launch mode at app level in config.xml but that applies to the entire app and not just for inappbrowser plugin.
## Alternatives or Workarounds
Currently when from App 1 if I open App 2 which is locally installed on the system using below method it opens it on top of the current app and app1 becomes hidden n inaccessible:
`this.inAppBrowser.create(url, '_system')`
I have done a temp work around which might not be correct in android source code for the plugin as below to open app2 in new task always (Keeping my app1 launch mode to singleTop itself)
```
`private void openExternalExcludeCurrentApp(Intent intent) {
// If the current app package isn't a target for this URL, then use
// the normal launch behavior
if (hasCurrentPackage == false || targetIntents.size() == 0) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // added this line
this.cordova.getActivity().startActivity(intent);
}
```
Contributor guide
Research direction
Start with the _system invocation and the Android openExternalExcludeCurrentApp entry point shown in the issue, then inspect how launch modes are currently read from config.xml. Define how a plugin-level launch-mode setting should interact with the existing app-level setting, and verify that opening another locally installed app leaves the current app accessible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, javascript
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100