diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
| commit | ef4f212fc1482136dba1e690ec589b315b4a377f (patch) | |
| tree | 0b7e16d72567fafcfd3e08d7c5c591ad07a63458 /StoneIsland/plugins/cordova-plugin-customurlscheme/www | |
| parent | 5fa81da81260d65113f57a293b6256d334fe8e2d (diff) | |
build 0.7.0
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-customurlscheme/www')
| -rw-r--r-- | StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js | 26 | ||||
| -rw-r--r-- | StoneIsland/plugins/cordova-plugin-customurlscheme/www/wp8/LaunchMyApp.js | 12 |
2 files changed, 36 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; + }()); diff --git a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/wp8/LaunchMyApp.js b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/wp8/LaunchMyApp.js new file mode 100644 index 00000000..a8172f0f --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/wp8/LaunchMyApp.js @@ -0,0 +1,12 @@ +(function () { + function activatedHandlerWinUI(e) { + if (typeof handleOpenURL == 'function' && e.uri) { + handleOpenURL(e.uri.rawUri); + } + }; + + if (typeof Windows != 'undefined') { + var wui = Windows.UI.WebUI.WebUIApplication; + wui.addEventListener("activated", activatedHandlerWinUI, false); + } +}());
\ No newline at end of file |
