wkh237 / react-native-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.61k stars 1.6k forks source link

react-native-fetch-blob override on the native XMLHttpRequest #569

Open mongy92 opened 7 years ago

mongy92 commented 7 years ago

Hi Everyone , i have Problem when i use "React-native-fetch-blob" with "react-native-google-places-autocomplete" .. the Problem is react-native-fetch-blob override on the native XMLHttpRequest when i use react-native-fetch-blob it give me this Problem .. 22215221_1810003175696537_2126190077_n and when i uninstall react-native-fetch-blob or when i remove this Line of Code window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest; the problem solved 22809784_1828998260463695_823543485_n .. Plz can any One Help me i Use "react-native": "0.46.4", "react-native-fetch-blob": "^0.10.8", "react-native-google-places-autocomplete": "^1.3.6",

Thanks

wdragon commented 6 years ago

I have noticed the same issue.

Aqueelmiq commented 6 years ago

I have noticed this problem as well

baltuonis commented 6 years ago

Same problem. Did you find solution?

baltuonis commented 6 years ago

Found the fix!

The problem is - that react-native-google-places-autocomplete sets undefined Referrer header.

You need to set origin in query prop of Autocomplete componentet (which translates to Referrer in HTTP request)

 query={{

            key: AppConfig.googleApiKey,
            ....
            origin: 'http://mywebsite.com'
          }}