【问题标题】:How To Redirect to Google Play App [FastAPI]如何重定向到 Google Play 应用程序 [FastAPI]
【发布时间】:2021-09-30 03:10:58
【问题描述】:

如何将移动用户直接重定向到 Google Play 应用程序?

现在我正在使用
RedirectResponse("https://play.google.com/store/apps/details?id=uz.bringo")
但它重定向到浏览器而不是应用程序

【问题讨论】:

    标签: fastapi


    【解决方案1】:
        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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-31
      • 2015-11-04
      • 2013-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多