summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-customurlscheme/www/android')
-rw-r--r--StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js
index 19dbdc0b..18fe0112 100644
--- a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js
+++ b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js
@@ -4,10 +4,18 @@
var remainingAttempts = 10;
function waitForAndCallHandlerFunction(url) {
- if (typeof window.handleOpenURL == "function") {
+ if (typeof window.handleOpenURL === "function") {
+ // 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,
+ "LaunchMyApp",
+ "clearIntent",
+ []);
+
window.handleOpenURL(url);
} else if (remainingAttempts-- > 0) {
- setTimeout(function(){waitForAndCallHandlerFunction(url)}, 500);
+ setTimeout(function(){waitForAndCallHandlerFunction(url);}, 500);
}
}
@@ -21,4 +29,18 @@
}
document.addEventListener("deviceready", triggerOpenURL, false);
+
+ var launchmyapp = {
+ getLastIntent: function(success, failure) {
+ cordova.exec(
+ success,
+ failure,
+ "LaunchMyApp",
+ "getLastIntent",
+ []);
+ }
+ }
+
+ module.exports = launchmyapp;
+
}());