-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cookies disable in for iOS #449
Comments
Running into this as well. Works fine on Android, however on iOS, cookies are not set. |
Also running into this -- cannot get cookies in iOS using CookieManager. Using javascript as a workaround: Future<String> getCookieWithJs(
String key, InAppWebViewController controller) async {
String cookie = await controller.evaluateJavascript(source: '''
document.cookie
.split('; ')
.find(row => row.startsWith('$key'));
''');
if (cookie.isNotEmpty) {
return cookie.split('=')[1];
}
return null;
} |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
I am using webview for payment gateway for one of my client. flutter_inappwebview 4.0.0+4
It is working perfectly for android in this plugin but when I run on iOS it is not working. Payment gateway error shows that cookies are disable in your browswer.
Here is the code.
body: InAppWebView( initialUrl: weburl, initialOptions: InAppWebViewGroupOptions(
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
if (url == successURL) {
Navigator.of(context).pushReplacementNamed('/NormalOrderSuccess',
arguments: RouteArgument(
heroTag: widget.routeArgument.heroTag, param: order));
} else if (url == failURL) {
Payment payment = order.payment;
payment.status = 'fail';
order.payment = payment;
Navigator.of(context).pushReplacementNamed(
'/NormalOrderSuccess',
arguments: RouteArgument(
heroTag: widget.routeArgument.heroTag, param: order));
}
},
onLoadStop: (InAppWebViewController controller, String url) async {
List cookies = await _cookieManager.getCookies(url: url);
cookies.forEach((cookie) {
print(cookie.name + " " + cookie.value);
});
},
onProgressChanged: (InAppWebViewController controller, int progress) {
},
),
)), );
The text was updated successfully, but these errors were encountered: