Skip to content

Android: Activating a notification from outside the app creates a new instance of the cordova activity - #149

Closed
amuino wants to merge 3 commits into
phonegap-build:masterfrom
amuino:single-launch-doc
Closed

amuino wants to merge 3 commits into
phonegap-build:masterfrom
amuino:single-launch-doc

Conversation

@amuino

@amuino amuino commented Jan 8, 2014

Copy link
Copy Markdown

When a notification is activated but the plugin is not active, an intent is created to activate the main activity:

https://github.com/phonegap-build/PushPlugin/blob/master/src/android/com/plugin/gcm/PushHandlerActivity.java#L60-L62

Since the default android:launchMode ( android docs ) causes a new instance of the activity to be created, a new webview is created even if the app is already running in background.

The simple solution is to change the launchMode so that a single instance is used.

This pull request adds documentation to the README.md and the plugin.xml so the developers are aware of this, since cordova does not allow adding the attribute automatically on plugin install.

EddyVerbruggen added a commit to Telerik-Verified-Plugins/PushNotification that referenced this pull request Jun 29, 2014
@EddyVerbruggen

Copy link
Copy Markdown

Manually partly merged this PR, thanks!

midas19910709 added a commit to midas19910709/phonegap-plugin-push that referenced this pull request Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants