Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

[Android] app not brought to foreground when launchMode = singleInstance #573

Closed
TonivdW opened this issue Feb 4, 2016 · 4 comments
Closed

Comments

@TonivdW
Copy link

TonivdW commented Feb 4, 2016

In my app I also use cordova-universal-links-plugin. In order to have this plugin behave the way I want I needed to set launchMode to singleInstance in the config.xml. Please see nordnet/cordova-universal-links-plugin#37
If I make this setting the result is that the app is no longer foregrounded on receipt of a push notification. I have verified that the notification is received, and the app processes it correctly and even navigates to the proper page, but all this is done in the background.
Is it possible to change some setting or add some lines of code in the push plugin to force the app to be foregrounded in this scenario?

@TonivdW
Copy link
Author

TonivdW commented Feb 5, 2016

I tried to workaround this by using https://github.com/caioladislau/cordova-toforeground to bring the app to the foreground when the push message is handled by the app, but apparently the push message is delivered to and handled by the app upon receipt, not at the moment the user clicks the notification. This effectively puts the app in foreground upon receipt of the notification. This is not the behavior I was looking for.
Maybe the code from this plugin could be used in plugin-push at the moment the user clicks the notification?

@TonivdW
Copy link
Author

TonivdW commented Feb 5, 2016

After I switched to lauchMode=singleTask all my issues seem to have vanished. I don't think any changes to plugin-push are needed.

@TonivdW TonivdW closed this as completed Feb 5, 2016
@viking2917
Copy link

I had exactly this issue, and singleTask solved it.

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants