Google authentication through cognito failing to redirect to application in react-native expo project using expo-auth-session library

I have set up google authentication through cognito in my react-native expo mobile application.

Using the expo-auth-session library, I make a call to my cognito user pool, which redirects to accounts.google.com, which after authentication redirects back to cognito, which then redirects back to the application.
This flow works perfectly on my IPhone emulator, yet it fails on my Android emulator.

I can successfully render the in-app webView in android, enter my account details, but after that I get a blank screen in the in-app browser and I am not redirected back to my application.

Since everything is from expo, I expect it to work without touching any native files.

I am kind of out of ideas, since it works for IPhone, I doubt that it has to do with the frontend code or the backend.

I have double, tripple and quadruple checked whether the redirect URI is correct, and added android specific scheme and host configuration to app.json.
Nothing has changed anything.

I’m unsure how to debug this issue, since in the backend everything works fine. User is authenticated, post confirmation function is triggered and executed, but nothing reaches back to the frontend. Our listener that waits on a change on the response variable is never triggered.

I am wondering whether it has to do with some native configuration… security, network, deep link settings… But that all should be managed by expo since it’s an expo project and library.

I would highly appreciate any help and or ideas on this topic. Thanks in advance!


Some code:
App.json

    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.fluentpal.frontend",
      "intentFilters": [
        {
          "action": "VIEW",
          "data": [
            {"scheme": "fluentpal", "host": "oauth2_redirect"}
          ],
          "category": ["BROWSABLE", "DEFAULT"]
        }
      ]
    },

AuthRequest

    const redirectUri = 'fluentpal://oauth2_redirect';
    const discoveryDocument = {
        authorizationEndpoint: `${userPoolUrl}/oauth2/authorize`,
        tokenEndpoint: `${userPoolUrl}/oauth2/token`,
        revocationEndpoint: `${userPoolUrl}/oauth2/revoke`,
    };
    const [request, response, promptAsync] = useAuthRequest(
        {
            clientId,
            responseType: ResponseType.Code,
            redirectUri,
            usePKCE: true,
            scopes: ['openid', 'profile', 'email', 'aws.cognito.signin.user.admin'],
            extraParams: {
                identity_provider: 'Google',
                prompt: 'login',
            }
        },
        discoveryDocument
    );

Listener

    useEffect(() => {
        if (response) {
            // Check if the response is of type error
            if ('error' in response && response.error) {
                Alert.alert(
                    'Authentication Error',
                    response.params.error_description || 'Something went wrong'
                );
                return;
            }
            if (response.type === 'success') {
                exchangeTokens({
                clientId,
                code: response.params.code,
                redirectUri,
                extraParams: {
                    code_verifier: request?.codeVerifier,
                },
                });
            }
        }
    }, [request, response]);

ANDROID EMULATOR BLANK SCREEN

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật