LoginSignup
0
1

More than 3 years have passed since last update.

ReactNative WebViewのCookieをクリアする簡単な方法

Posted at

WebViewのCookieを操作するには、例えば https://github.com/joeferraro/react-native-cookies などが使えます。

が、linkだとかなんとか面倒くさい。
全消したいだけやねんけど。

そんなときに、かなり簡単な方法があるようです。

import { NativeModules } from 'react-native';

NativeModules.Networking.clearCookies(() => { });

clearCookies の引数(コールバック)は必ず書かないとクラッシュするようです。

参考: react-nativeでWebView内のCookieをjsのコードのみで削除するには的なお話

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1