You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.
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 not the user entered zipcode. When pass useWebKit to true and CookieManager.get('https://www.example.com', true) getting error RNCookieManagerIOS.get was called with 2 arguments but expects 1 arguments
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com', true)
// when pass true getting error RNCookieManagerIOS.get was called with 2 arguments but expects 1 arguments
.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
useWebKit
originWhitelist={['*']}
/>
Yes, I am using the true for useWebKit: bool.
Well I tried two approaches:
First:
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com')
.then((res) => {
console.log('CookieManager.get from webkit-view =>', res);
// this gives me an object with the server sent cookies but not the user set zipcode
});
}
}
<WebView
style={styles.webview}
source={{ uri: 'https://www.example.com' }}
injectedJavaScript={INJECTED_JAVASCRIPT}
mixedContentMode="compatibility"
javaScriptEnabled
domStorageEnabled
thirdPartyCookiesEnabled
sharedCookiesEnabled
originWhitelist={['*']}
/>
Second:
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com', true)
// when pass true getting error RNCookieManagerIOS.get was called with 2 arguments but expects 1 arguments
.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
useWebKit
originWhitelist={['*']}
/>
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 not the user entered zipcode. When pass useWebKit to true and CookieManager.get('https://www.example.com', true) getting error RNCookieManagerIOS.get was called with 2 arguments but expects 1 arguments
Versions
The text was updated successfully, but these errors were encountered: