简体   繁体   中英

How to redirect from Facebook browser to Android market?

In my site, there is a link that once clicked, goes through a series of redirect that eventually should go to the app market.

The final redirect URL is something like:

market://details?id=APP-IDENTIFIER

And it is started by calling:

window.open(url,"_blank")

On Android, when clicking in a regular browser - all works well. When opening the page in the facebook browser , the redirect fails with the following message:

The webpage could not be loaded as" net::ERR_UNKNOWN_URL_SCHEME

I am aware that any app may block custom scheme access, but is there a way to overcome this?

It seems that the problem is oddly solved by starting the redirect chain by calling:

window.open(url,"_top")

instead of *_blank.

don't user the market:// identifier, but the actual play store link https://play.google.com/store/apps/details?id=<APP-ID>

  • if the app is not blocking, the Play Store will open with no issues
  • if the app is blocking launching of apps, at least you'll show the Play Store page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM