summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js')
-rw-r--r--StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js24
1 files changed, 24 insertions, 0 deletions
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);
+}());