Skip to content

Commit

Permalink
#155 Plugin nulls out intent data on Android so it can't be used by o…
Browse files Browse the repository at this point in the history
…ther code
  • Loading branch information
EddyVerbruggen committed Feb 26, 2016
1 parent 6c9d967 commit 480a688
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/android/nl/xservices/plugins/LaunchMyApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class LaunchMyApp extends CordovaPlugin {
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView){
this.resetIntent = preferences.getBoolean("resetIntent", false) ||
preferences.getBoolean("CustomURLSchemePluginClearsAndroidIntent", false) ||
preferences.getBoolean("CustomURLSchemePluginClearsAndroidIntent", false);
}

@Override
Expand All @@ -51,7 +51,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
final Intent intent = ((CordovaActivity) this.webView.getContext()).getIntent();
final String intentString = intent.getDataString();
if (intentString != null && intent.getScheme() != null) {
lastIntentString = intentString;
lastIntentString = intentString;
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, intent.getDataString()));
} else {
callbackContext.error("App was not started via the launchmyapp URL scheme. Ignoring this errorcallback is the best approach.");
Expand Down
2 changes: 1 addition & 1 deletion www/android/LaunchMyApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

function waitForAndCallHandlerFunction(url) {
if (typeof window.handleOpenURL === "function") {
// Clear the intent when we have a handler
// Clear the intent when we have a handler (note that this is only done when the preference 'CustomURLSchemePluginClearsAndroidIntent' is 'true' in config.xml
cordova.exec(
null,
null,
Expand Down

0 comments on commit 480a688

Please sign in to comment.