Skip to content

Commit

Permalink
README Cordova config prevent Android many apps
Browse files Browse the repository at this point in the history
Following nordnet#37 and nordnet#38, updated README Cordova config preferences section with a new sub-section to detail how to prevent Android from creating multiple instances of the App when clicking on a link from another App.
  • Loading branch information
ghybs authored Jul 4, 2016
1 parent cc1a7b7 commit e73579c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ will result into

This is iOS-only preference, Android doesn't need it.

#### Prevent Android from creating mutiple app instances

When clicking on a universal link from another App (typically from an email client), Android will likely create a new instance of your app, even if it is already loaded in memory. It may even create a new instance with each click, resulting in many instances of your app in the task switcher. See details in [issue #37](https://github.com/nordnet/cordova-universal-links-plugin/issues/37).

To force Android opening always the same app instance, a known workaround is to change the [activity launch mode](https://developer.android.com/guide/topics/manifest/activity-element.html#lmode) to `singleInstance`. To do so, you can use the following preference in Cordova `config.xml` file:
```xml
<preference name="AndroidLaunchMode" value="singleInstance" />
```


### Application launch handling
As mentioned - it is not enough just to redirect a user into your app, you will also need to display the correct content. In order to solve that - plugin provides JavaScript module: `universalLinks`. To get notified on application launch do the following:
```js
Expand Down

0 comments on commit e73579c

Please sign in to comment.