Last active
January 11, 2018 21:53
-
-
Save hansemannn/d2263475b40469d3f2e4b82f03cc345c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var btn = Ti.UI.createButton({ | |
title: "Open safari dialog" | |
}); | |
btn.addEventListener("click", function() { | |
safari.open({ | |
url:"http://hans-knoechel.de/TIMOB-23884.php", | |
title:"Hello World" | |
}); | |
}); | |
Ti.App.iOS.addEventListener("handleurl", function(e) { | |
// If the handled url is provided by the safari-dialog, close it (use-case for OAuth) | |
if (e.launchOptions.source == "com.apple.SafariViewService") { | |
safari.close(); | |
} | |
}); | |
win.add(btn); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment