Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Last active January 11, 2018 21:53
Show Gist options
  • Save hansemannn/d2263475b40469d3f2e4b82f03cc345c to your computer and use it in GitHub Desktop.
Save hansemannn/d2263475b40469d3f2e4b82f03cc345c to your computer and use it in GitHub Desktop.
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