I am trying to retrieve user entered zipcode which is added to the cookie in the webview. How do I get it?
I have tried react-native-cookies
which is getting an empty object.
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com')
.then((res) => {
console.log('CookieManager.get from webkit-view =>', res);
});
}
}
<WebView
style={styles.webview}
source={{ uri: 'https://www.example.com' }}
injectedJavaScript={INJECTED_JAVASCRIPT}
mixedContentMode="compatibility"
javaScriptEnabled
domStorageEnabled
thirdPartyCookiesEnabled
sharedCookiesEnabled
originWhitelist={['*']}
useWebKit
/>
I am trying out in iOS simulator. Android works great. I see https://github.com/react-native-community/react-native-webview/pull/175 as merged but can't figure out how to use it to get the user set cookies.