Async-storage: can't get value with getItem

Created on 6 Aug 2019  Ā·  5Comments  Ā·  Source: react-native-async-storage/async-storage

Current behavior


In Android, I can't got the value after I add Facebook SDK in to my project.(the network in china)

_bootstrapAsync = async () => {
    const userId = await AsyncStorage.getItem('login');
    console.log(userId);
    // This will switch to the App screen or Auth screen and this loading
    // screen will be unmounted and thrown away.
    this.props.navigation.navigate(userId ? 'App' : 'Auth');
  };

Expected behavior


get the value

Repro steps

Environment

  • Async Storage version:1.6.1
  • React-Native version: 0.59.10
  • Platform tested: Android
  • Logs/Error that are relevant:

Most helpful comment

I use the DedicatedExecutor method fix the problem.

All 5 comments

I'd need more info to know what's the problem. Are you sure you're saving the data correctly?

Yeah, I had saved the data, it is normal in IOS. I tried use sync storage method likes realm, It is ok, but realm is more complicated.

I think it is Facebook android SDK initializationā€˜s conflict

@mingxin-yang is there any error you get while retrieving the data?

I use the DedicatedExecutor method fix the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mxmzb picture mxmzb  Ā·  19Comments

Alaa-Ben picture Alaa-Ben  Ā·  20Comments

StevenMasini picture StevenMasini  Ā·  22Comments

muhammadn picture muhammadn  Ā·  58Comments

michaelsinatra picture michaelsinatra  Ā·  24Comments