react-native - 跨应用程序共享AsyncStorage吗?

标签 react-native asyncstorage

我的问题来自文档:https://facebook.github.io/react-native/docs/asyncstorage.html#clear

AsyncStorage.clear -> Erases all AsyncStorage for all clients, libraries, etc....



这是否意味着所有应用共享相同的AsyncStorage?

最佳答案

AsyncStorage是而不是在多个应用程序之间共享。每个应用程序都在其自己的沙盒环境中运行,并且无法访问其他应用程序。

仅调用AsyncStorage.clear意味着您将删除应用程序已存储在AsyncStorage中的所有数据。

包括

  • 由使用AsyncStorage的库存储的所有数据,例如
    https://github.com/sunnylqm/react-native-storage
  • 来自所有用户的所有数据(如果是多用户)

  • 有关应用沙箱的更多信息,您可以阅读以下答案:
    What is Sandbox in ios , Can i Trans data between in one App to Another App in iPhone,if possible how

    关于react-native - 跨应用程序共享AsyncStorage吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48790764/

    相关文章:

    react-native - React Native codePush 重启后回滚

    React-Native 选择器 - 更改字体大小

    react-native - React Native 的 AsyncStorage 可能失败的案例有哪些?

    reactjs - 如何将 React 中的 localStorage 代码转换为 React Native 中的 AsyncStorage?

    javascript - Navigator 和 AsyncStorage react native

    android - 在vue-native中使用react-native

    javascript - native 模块 - 返回 promise 时的最佳约定

    react-native - 根据产品口味动态链接包,以一个代码库支持GMS和HMS

    reactjs - 在 useEffect Hook 中设置状态以及 AsyncStorage 会导致无限循环?

    react-native - 从AsyncStorage获取 token 来创建Axios实例