joeferraro / react-native-cookies

Cookie manager for React Native
MIT License
788 stars 315 forks source link

RNCookieManagerIOS.clearAll was called with 1 arguments but expects 0 arguments if you hacernt this method yourself this usually means that your versions of the native code and javascript code are out of sync up #78

Open tianweicc opened 7 years ago

tianweicc commented 7 years ago

RNCookieManagerIOS.clearAll was called with 1 arguments but expects 0 arguments if you hacernt this method yourself this usually means that your versions of the native code and javascript code are out of sync up

yusheng-jia commented 6 years ago

CookieManager.clearAll().then(function(res){ console.log('CookieManager.clearAll =>', res); })

ollyde commented 5 years ago

@yusheng-jia it doesn't actually clear the cookies though. Actually does nothing. I tried linking twice and clearing the project so that it was rebuilt. No luck.

Also the main reason why we pass in the boolean is to specify webKit correct?

tmaly1980 commented 5 years ago

I'm running into this same issue. Any luck? I think part of the issue is the package on npmjs.com doesn't include the useWebKit parameter. It's outdated and I've had to npm install from the git repo. However, I still have this complaint and it doesn't work. I've looked at the RNCookieManagerIOS.m file, and it does use the useWebKit BOOL. I've cleaned my project, removed node_modules, deleted the app from the simulator, etc. No idea what's wrong.

tmaly1980 commented 5 years ago

Actually I think what I needed was to pass "useWebKit" and "sharedCookiesEnabled" to my WebView, and then call CookieManager.clearAll(true) and CookieManager.clearAll(false). I tried running one or the other and it didn't work to clear the cookie, but calling both did.

ashtrus commented 5 years ago

I've got same error when tried to use CookieManager.clearAll(true). I used version 3.3.0, but changes required to pass true as a function parameter, is implemented after version bump. To fixed that i used specific commit that has these changes and it fixed that issue for me. git+ssh://git@github.com:joeferraro/react-native-cookies.git#48240c3 I used this specific commit.

safaiyeh commented 4 years ago

I have forked the repo here: https://github.com/safaiyeh/react-native-cookie-store We can create issues and PRs there to continue the development of the project.