Как перенаправить на приложение Google Play [FastAPI]

#fastapi

Вопрос:

Как я могу перенаправить мобильного пользователя непосредственно в приложение Google Play?

Теперь я использую
RedirectResponse("https://play.google.com/store/apps/details?id=uz.bringo")
но он перенаправляет на браузер, а не на приложение

Ответ №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