【发布时间】:2021-09-30 03:10:58
【问题描述】:
如何将移动用户直接重定向到 Google Play 应用程序?
现在我正在使用 RedirectResponse("https://play.google.com/store/apps/details?id=uz.bringo")
但它重定向到浏览器而不是应用程序
【问题讨论】:
标签: fastapi
如何将移动用户直接重定向到 Google Play 应用程序?
现在我正在使用 RedirectResponse("https://play.google.com/store/apps/details?id=uz.bringo")
但它重定向到浏览器而不是应用程序
【问题讨论】:
标签: fastapi
from user_agents import parse
ua = parse(request.headers.get('user-agent'))
if ua.is_mobile:
if ua.os.family.lower() == 'ios':
resp = RedirectResponse("https://apps.apple.com/uz/app/bringo/id1470378530")
else:
rsp = RedirectResponse("https://play.google.com/store/apps/details?id=uz.bringo")
return resp
【讨论】: