Network/Internet Links

I’m trying to make an app where if you click on the Website icon, it takes you to the url of the website by either, opening up an app like chrome and going to the link, or open up a web view in your app (doesn’t matter), and if you click on Facebook, it opens up the facebook app. Facebook can wait for now though, but how do you just have a basic script that links to a website and opens it up?

Hi there,

You can use system.openURL() (see here:http://docs.coronalabs.com/api/library/system/openURL.html) to open up a URL in the device’s browser.  Is that what you’re looking for?  This would cause your app to be suspended.  If you want to remain within your app, you could open up the page using a webview like you mentioned, using either native.showWebPopup() or native.newWebView().

  • Andrew

That’s perfect, just what I just looking for, thanks

Hi there,

You can use system.openURL() (see here:http://docs.coronalabs.com/api/library/system/openURL.html) to open up a URL in the device’s browser.  Is that what you’re looking for?  This would cause your app to be suspended.  If you want to remain within your app, you could open up the page using a webview like you mentioned, using either native.showWebPopup() or native.newWebView().

  • Andrew

That’s perfect, just what I just looking for, thanks