From ef14c875d7056f90be606ebf1f389c112b947f81 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 30 Nov 2015 23:07:12 -0500 Subject: canadian country code --- .../www/android/LaunchMyApp.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js (limited to 'StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js') diff --git a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js new file mode 100644 index 00000000..19dbdc0b --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js @@ -0,0 +1,24 @@ +(function () { + "use strict"; + + var remainingAttempts = 10; + + function waitForAndCallHandlerFunction(url) { + if (typeof window.handleOpenURL == "function") { + window.handleOpenURL(url); + } else if (remainingAttempts-- > 0) { + setTimeout(function(){waitForAndCallHandlerFunction(url)}, 500); + } + } + + function triggerOpenURL() { + cordova.exec( + waitForAndCallHandlerFunction, + null, + "LaunchMyApp", + "checkIntent", + []); + } + + document.addEventListener("deviceready", triggerOpenURL, false); +}()); -- cgit v1.2.3-70-g09d2