How to open a url on Android?


Please help.
I use C2 and webview+. I have a button in my Android game and it should lead the user on Facebook.
However, it does not work via C2 native “Browser” plugin. Also, it doesn’t work with the “Cocoon Canvasplus” plugin. Nothing happens when I press the button on Android device. What am I doing wrong? Do I need to do on “plugins” pages something special? On Intel XDK everything is working well (with native C2 “Browser”). I have this problem only with URL’s opening in an application should be the easiest thing in the world! Heh.


I wouldn’t say that Bob.

I’ve been days trying to open a simple web page in my iOS app. No luck so far. By default, you’re not meant to be able to reach the outside world but trying to override that is a pain. Obviously, you’re working with Android but I’ve certainly had problems with iOS.


you can use the Open URL action of the CocoonCanvasPlus plugin.



Hi Andy, thanks for your answer.
I used the CocoonCanvasplus plugin in my C2 project, as I said.
It doesn’t work. Can you tell me step by step how you get the CanvasPlus plugin to work in your applications?


Hi @Bob

I only added the CocoonCanvas+ plugin to my c2 project and linked the button sprite with the CanvasPlus action “Open URL” (I’m not quite sure if this is the exact name of the action).
Then when I built the game it opened the URL.
Maybe try to add the InApp Browser in the plugin section of your CocoonIO project (your project -> Plugins -> Core -> inappbrowser -> install)



Hi @andy_reitberger

I did just like you say. It doesn’t help. Perhaps it is because I use Webview+ (webview engine)? Not the Canvas+? Really weird and frustrating problem.


hey guys just trying to help i never try to build with webview+ but this i the how i do it and it work check out this game on look how it work


Hi @Bob,

Yes that’s the reason. the canvas+ plugin only works on canvas+. But if you use WebView+ you can use the Browser plugin in order to open an URL. But remember to install the inappbrowser plugin too.



Hi @andy_reitberger

I did as you mentioned. But it still doesn’t work on Android device. There is my setup:

pic 1.

pic 2.

Thanks for your answer, but it doesn’t help in my situation.


Hi @Bob

I just built a test case with construct 2 and it works all fine for me with following code.

Don’t get confused about the logs, those are just for debugging. The Open URL action uses an installed browser to open the link. Have you one installed on your test device?

Otherwise it should use the inappbrowser.

Thank you!



Hi @andy_reitberger

Yes, I have a browser on my device. And everything works with Intel XDK, but not with
I’ve done everything exactly as you. But the button just don’t work. The browser doesn’t open any link on the phone. Do you use webview+ when you build your test? Maybe you can send your test project to me and I try to build it and test on my Android device?
Thanks for your help!


Hi @Bob,

I did use Canvas+, but it also should work on WebView (due to the “else” condition).
Sure, here you can download my test case.

you also find there my Developer App, so firstly download and install the developer app, then download and run the zip file.
Let me know if this works for you!

Thank you!



Hi @andy_reitberger

Ok, I did tests with your test case (thanks for the sample!). And here is the result:
Everything works fine, if you use the Canvas+. But the url link doesn’t open if you use the Webview+. To me, it’s looks like a Cocoon bug and it’s clearly linked to the Webview+ (because everything works fine when you use the Canvas+). Can Cocoon team do anything about this?


I have to be in agreement with this. I have had to give up trying to access anything externally in iOS too. I have gone into my .ipa and observed the .plist file, to double-check that all of my settings are correct. I’ve been in touch with Dave Alden, who has been able to confirm it’s not the standard plugin which I’m trying to use. There is nothing left for me to consider, other than the current version of Cocoon is just not working.

I agree that I may not be right but I am out of options now and have tried everything suggested and which my team can think of.


…that is, using Webview+ of course.


Hi @Bob

I did not installed the “inapbrowserplugin” for this developer app, so I guess this is the reason why it doesn’t work with WebView+.
Or did you test it aswell with your developer app?


Yes, I’ve tried the InAppBrowser plugin too. No luck.

The odd thing is, the Cocoon Developer App does work, so there’s something about that.

Maybe they built it in an earlier version.
Maybe they built it in Cordova, not Cocoon.
Maybe it was simply built in Xcode

… but they have remote access and we don’t.


The Developer App has some pre-installed plugins included, so this could be why it works with the Developer App, but not with the live app.

But just to be clearly, I only use Canvas+.



That’s very interesting, Andy, thank you for that.

Are these plugins which are available to install; i.e. should we just install everything to make it work if we can’t find the specific one to do the job?

I was reluctant to go the Canvas+ route due to the use of text input and it breaking on the DOM to begin with. What are your views with this?




Hi Malc,

You find details of the installed Plugins over here.

I’ll make some researches on my end too.
If you figure out what plugin it was, please let me know.