-
-
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
Cant get cookie IOS #221
Comments
I also have this error and I could trace down the problem. It seems that when the cookies are read out, the code always tries to compare the URL with the cookie domain. But unfortunately, the domain field is optional. So it will be nil sometimes and that makes the code crash. The affected lines of code are here: flutter_inappwebview/ios/Classes/MyCookieManager.swift Lines 105 to 109 in 9c7ac0d
Edit: actually upon debugging, I found out this was my mistake. The URL I tried it with was |
This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it. |
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. |
Environment
Flutter version: 1.9.6
Plugin version:
Android version:
iOS version: 11.1
Xcode version:
Device information:
Description
InAppWebView(
initialUrl: _webviewUrl,
initialOptions: InAppWebViewWidgetOptions(
iosInAppWebViewOptions: IosInAppWebViewOptions(
sharedCookiesEnabled: true,
),
inAppWebViewOptions: InAppWebViewOptions(
debuggingEnabled: true,
)),
onWebViewCreated: (InAppWebViewController controller) {
_webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
getCookies();
setState(() {
_webviewUrl = url;
});
webViewURLChange();
},
onLoadError: (InAppWebViewController controller, String url,
int code, String message) {
Navigator.of(context).pop(null);
},
onLoadStop: (InAppWebViewController controller, String url) {
getCookies();
},
onProgressChanged:
(InAppWebViewController controller, int progress) {
setState(() {
_progress = progress / 100;
});
void getCookies() async {
var cookies = await CookieManager.instance().getCookie(url : 'https://facebook.com/', name: 'c_user');
print(cookies);
//checkLogin();
}
but not print cookie
Expected behavior:
Current behavior:
Steps to reproduce
Images
Stacktrace/Logcat
The text was updated successfully, but these errors were encountered: