Sign in to follow this  
erich

How to link to url in app ?

Recommended Posts

Hi

This has me so confused, how do I link to a url in an android app,

eg.

playButton.press = () =>
    {
            window.location.href="http://example.com";       
    }

It works fine in when playing my game in desktop, but once I try it as an app on my device nothing happens ? 

Any ideas

Eric

Share this post


Link to post
Share on other sites

Found the problem, I needed to use the whitelist plug-in the  PhoneGap and then in my config.xml I included :

<plugin name="com.indigoway.cordova.whitelist.whitelistplugin" spec="1.1.1" source="pgb" />

<feature name="Whitelist" >
                <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin"/>
                <param name="onload" value="true" />
</feature>

<allow-intent href=" http://example.com /*" />
<allow-navigation href=" http://example.com /*" />
<access origin="http://example.com" />

Hope this helps someone else that may get stuck on it

ERic 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.