Expo, try send token with fetch to custom server

Hello!
I try to send expo token to custom server use fetch
in emulator on android studio works well, but when i build apk file, nothing hepend

there code, i use expo

return fetch(PUSH_REGISTRATION_ENDPOINT, {
            method: 'POST',
            headers: {
                'Accept': 'application/json, text/plain, */*',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({dataObj}),
        }).then((response) => response.json()).then((responseJsonFromServer) =>{
            alert("Connect");
            if(responseJsonFromServer.thx == 'thx'){
                alert("Data added");
            }
            //console.log(responseJsonFromServer);
        }).catch((error) =>{
            console.error(error);
        });

Hey @elvisfas, have you ensured that your server is accessible from outside the local network?

Cheers,
Adam

Hello, @adamjnav ! ofc! in ios work well
but when build apk, not work in this code part

i have test axios
in emulator - work
but build apk, not work too

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.