Opening URLs in a browser - RoboVM / iOS

I have an Android game that uses LibGDX. In it, I have a few buttons for opening URLs in a browser with:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://myURL/")); startActivity(intent); 

And it works fine ...

The problem is that I am trying to port the game to iOS using RoboVM and cannot figure out how to configure something like this.

With RoboVM bindings, I suggested that I probably want to use the openURL () method:

 openURL (UIApplication application, NSURL url, String sourceApplication, NSObject annotation) 

But besides NSURL, I do not know what I need to pass for the other 3 parameters. And it was not possible to find examples online about how to use it.

+6
source share
1 answer

Libgdx already has an abstraction that works on all supported platforms (Android, Desktop, HTML5 and iOS).

Net # openURI

 Gdx.net.openURI("http://stackoverflow.com/questions/21242116/opening-urls-with-the-browser-robovm-ios"); 

(This is an implementation of RoboVM: RoboVM IOSNet # openURI as a reference, use abstraction. You do not need to make platform-specific code when libgdx has already done this for you;))

+12
source

All Articles