-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS CookieManager setCookie doesn't wait for cookie to actually have been set #196
Comments
#198 this may help you :) |
Updated the master branch with that fix and created the new 1.2.2 version with only that fix. |
Wow, that was fast! Thank you @robertcnst and @pichillilorenzo! 🍻 |
@pichillilorenzo Thanks! We've now verified that the fixed version works without any workarounds for setting the cookies. |
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. |
Hi and thanks for the great library! Especially happy about the scroll callback which allows us to implement some nice effects in our app.
We have one problem though - we inject a particular login session used by the outside app to inside InAppWebViews using CookieManager. On Android this works perfectly. On iOS the cookies aren't available in the InAppWebView reliably when needed, especially if another InAppWebView has been alive in the app before.
I think this might be due to the iOS CookieManager not passing a
completionHandler
when it calls thesetCookie
method:https://github.com/pichillilorenzo/flutter_inappbrowser/blob/68ff79c71686987fc5bdc447f2c68a723a821ca6/ios/Classes/MyCookieManager.swift#L96
That WKHTTPCookieStore method DOES have a completion handler, like the other methods we're calling, which we pass a completion handler to: https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882007-setcookie?language=objc
Is there some reason why the completion handler isn't used here? As a workaround, we can loop to check for the cookies having been set, but that's a bit messy.
The text was updated successfully, but these errors were encountered: