summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-customurlscheme/www
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-customurlscheme/www')
-rw-r--r--StoneIsland/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js24
-rw-r--r--StoneIsland/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js9
-rw-r--r--StoneIsland/plugins/cordova-plugin-customurlscheme/www/windows/LaunchMyApp.js10
3 files changed, 43 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);
+}());
diff --git a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js
new file mode 100644
index 00000000..a1d60818
--- /dev/null
+++ b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js
@@ -0,0 +1,9 @@
+"use strict";
+
+/*
+ Q: Why an empty file?
+ A: iOS doesn't need plumbing to get the plugin to work, so..
+ - Including no file would mean the import in index.html would differ per platform.
+ - Also, using one version and adding a userAgent check for Android feels wrong.
+ - And if you're not using PhoneGap Build, you could paste your handleOpenUrl JS function here.
+*/
diff --git a/StoneIsland/plugins/cordova-plugin-customurlscheme/www/windows/LaunchMyApp.js b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/windows/LaunchMyApp.js
new file mode 100644
index 00000000..a70d5e94
--- /dev/null
+++ b/StoneIsland/plugins/cordova-plugin-customurlscheme/www/windows/LaunchMyApp.js
@@ -0,0 +1,10 @@
+(function () {
+ function activatedHandler(e) {
+ if (typeof handleOpenURL == 'function' && e.uri) {
+ handleOpenURL(e.uri.rawUri);
+ }
+ };
+
+ var wui = Windows.UI.WebUI.WebUIApplication;
+ wui.addEventListener("activated", activatedHandler, false);
+}());