android - React-natives AsyncStorage does not work -
i trying call function includes asyncstorage-calls (receives , stores data 'tutorialnotover'). program worked while ago somehow got broken. react-native not give me warnings or errors, don't work right. looks program skips call of getfirsttime()-function.
<view> ... {this.props.firsttime = this.getfirsttime} ... </view> ... async getfirsttime(){ let firsttime = "null"; try{ firsttime = await asyncstorage.getitem('tutorialnotover', (err, result) => { console.log("getfirsttimefirsttime: " + result); }); } catch (error){ console.log(error); } if (firsttime === 'null') { firsttime = 'true'; } if (firsttime === "true") { try{ asyncstorage.setitem('tutorialnotover', "true"); return true; } catch (error){ console.log(error); } } return false; }
Comments
Post a Comment