Making a link open up in CocoonJS

  • Hello everyone,

    Just got our game going to Apple for approval for iOS!!! We want to make a free version too that when you get to a certain level it gives you the option to buy the game. So I need to know, is there any way of opening an external link to the App Store from within CocoonJS to the full game???

    I just read that they do support that in the latest build of CocoonJS so I guess the question is, how do I set up Construct 2 to allow me to do this?

    Thank you all

  • I don't know how to from Cocoon only, but the latest Clay.io plugin has it as a simple event (working through Cocoon). You can check it out here: clay.io/members/community

  • The Browser object's 'Open URL' action uses CocoonJS's open URL function when in CocoonJS.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Nice one, I will try that out asap!

  • The Browser object's 'Open URL' action uses CocoonJS's open URL function when in CocoonJS.

    Neither the Browser object's:

    Go To URL

    or

    Open URL in New Window

    seem to work. They just go to black screen

    I have tried using the CocoonJS launcher, and also cloud compilation on 3 iOS decices ( iphone 3, 5 and iPad )

    Has anyone else actually got this working?

    Thanks

    Danny

  • Same problem here. Tried using both open url and open url in a new window, but no success. Has anyone tried alternative methods?

  • I don't actually use Construct but this also took me quite a while to get so I thought I'd share. Here's how to open up links inside CocoonJS:

    Include CocooJS.js and CocoonJS_App.js in your html file

    <script src="js/extensions/CocoonJS.js"></script>
    <script src="js/extensions/CocoonJS_App.js"></script>
    

    Then use

    CocoonJS.App.openURL(yourUrlHere);

    You might need to change the <script> tag to point where your CocoonJS.js and CocoonJS_App.js files are.

    Cheers!

  • jaunesarmiento

    Thank you so much, It's working

    <img src="smileys/smiley41.gif" border="0" align="middle" />

  • jaunesarmiento

    Where do I find these 2 js files

    and how do I use the > CocoonJS.App.openURL(yourUrlHere);

    on touch a sprite

    REGARDS

    Flemming

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)