Estoy tratando de realizar un Post para mandar una Push Notification mediante Expo, esto para una aplicación desarrollada en React native, lo estoy realizando desde Javascript y me manda este error
Failed to load https://exp.host/--/api/v2/push/send: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://expo.io' that is not equal to the supplied origin. Origin 'http://127.0.0.1:62697' is therefore not allowed access. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
lo subi a mi servidor donde tengo alojada mi pagina pero me manda el mismo error este es el codigo
const config = {
method: 'POST',
headers: {
Accept: "application/json",
"Accept-Encoding": "gzip,deflate",
"Content-Type": "application/json"
},
body: JSON.stringify({
"to": "ExponentPushToken[omijKxCLlMs4A_jQn10rnV]",
"sound": "default",
"body": "Prueba post"
})
};
fetch("https://exp.host/--/api/v2/push/send", config)
.then(res => res.json())
.then(res => {
//console.log(res)
//return res.secure_url
})
.catch((err) => {
//console.log(err)
})