Skip to content

Instantly share code, notes, and snippets.

@JiangWeixian
Created December 14, 2019 09:54
Show Gist options
  • Save JiangWeixian/5fb691c2f47bd193dc7770a73175def1 to your computer and use it in GitHub Desktop.
Save JiangWeixian/5fb691c2f47bd193dc7770a73175def1 to your computer and use it in GitHub Desktop.
open app
/**逻辑类型类似。
* 1. 尝试通过schema打开app
* 2. 如果安卓就跳转到下载链接 or apple内就打开apple store
* refs: https://juejin.im/post/59aabe4c6fb9a0249471e04a
* (链接内写的比较详细了。)
*/
// 打开schema(以打开taobbao item为例)
window.location = taobao://item.taobao.com/
// 打开apple store。主要是appname和appid。
<a href="https://apps.apple.com/cn/app/%E6%89%8B%E6%9C%BA%E6%B7%98%E5%AE%9D-%E6%B7%98%E5%88%B0%E4%BD%A0%E8%AF%B4%E5%A5%BD/id387682726" id="openApp">淘宝</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment