Opening URLs in Chrome for iOS
For iOS users, the default browser is still Safari. iOS 8 added some new features called extensions, which allowed developers to be able to add commands to Open with menus so that their apps could handle certain types of data. But the default for clicking on a link will always be Safari.
In your own apps, however, you can override this by opening links with a specific URL scheme that relates to Chrome for iOS. When you do this, the link that you specify will be opened in Chrome if it's installed on the user's device.
How to do it
- Go back to the
app.js
file in Studio and add some more code. First, we need to add a new label, so we add this under ourlabel3
definition:var label4 = Ti.UI.createLabel({ left: 30, top: 250, text: "Open a link in Chrome" });
- Next, we need to add the label to the window. So, add the next line of code under the code that adds the three existing labels:
win.add(label4);
- Now we need to add the code that will...