Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

How to open browser links when pressing button?

So as far as I'm concerned inside the game engine (C2 my instance) you have to code the command to open a link when pressing a button which I did and inside IntelXdk you have to add the inAppBrowser plugin,and thats all right?I've been deleting the content in the config.additions as well which is what would cause the build to fail.Now to my problem,I've managed to get the game on the play store and found out that when I touch the buttons (rate button) the sound and animation happens but no browser opens.Same with the leaderboard button which I think the problem with that is that the player doesnt manage to sign in to Google Play Games as he gets an error saying *Unknown error.SIGN_IN_REQUIRED(4).Which I'm pretty sure I missed something and that error appears.

 

Tags (2)
0 Kudos
3 Replies
Highlighted
9 Views

See the doc page for the inappbrowser plugin for clues on how to open the mobile browser from your app using that plugin > https://github.com/apache/cordova-plugin-inappbrowser

0 Kudos
Highlighted
Beginner
9 Views

Not helpful,anyone else?I've done like 10 builds of the same project with no success in solving the problem.

0 Kudos
Highlighted
New Contributor I
9 Views

Cee N. wrote:

Not helpful,anyone else?I've done like 10 builds of the same project with no success in solving the problem.

Hey @Cee N. Try this one.

Add this to the header...

<script>
            function join_browser() {
                cordova.InAppBrowser.open('https://www.example.com/page/join', '_blank', 'location=yes');//just change the url
            }

</script>

 

Then your button look like this..

<input type="button" class="text-style link" onclick="join_browser();return false;"  value="Register here">

 

Hope that will help. Don't forget to add the cordova inappbrowser plugin.

0 Kudos