Link to a webpage

Hey, is there an easy way to make a button that will send the user to a webpage/storepage or a Facebook-page?

1 Like

Yes there is.

sys.open_url("http://www.defold.com")

http://doc.defold.com/ref/sys#sys.open_url

4 Likes

Thank you.
Will it only open the webbrowser or does a mobile now if the url can be open in FaceBook or app/google store?

Not sure but I think that is handled by the device OS.

1 Like

I think this is handled automatically on Android at least. If you do a sys.open(“market://details?id=[your_package_name]”) I’m almost 100% sure it’s opened using Google Play. It could also work for the normal Play Store links (https://play.google.com/store/apps/details?id=[your_package_name]), but I guess you’d have to try that yourself.

2 Likes