rnas

1.0.29 • Public • Published

rn-async-storage

Why?

AsyncStorage not fulfilling promise on Android 7+
I hope this problem will be solved, but issue https://github.com/facebook/react-native/issues/14101 was created at 22 May 2017.
Today 15 Apr 2018
This is very quickly solution for android

Just replace

import {AsyncStorage} from 'react-native'

to

import {AsyncStorage} from 'rn-async-storage'

.. thats all! :)

For ios you can use all function of AsyncStorage

sorry but only works

  • setItem(key, value)
  • getItem(key)
  • getAllKeys()
  • removeItem(key)
  • clear()

If you need other methods from AsynStorage let me know

For ios you can use all function from AsynStorage

Getting started

$ npm install rn-async-storage --save

or

$ yarn add rn-async-storage

Mostly automatic installation

$ react-native link react-native-rn-async-storage

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactlibrary.RNAsyncStoragePackage; to the imports at the top of the file
  • Add new RNAsyncStoragePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':rn-async-storage'
    project(':rn-async-storage').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-rn-async-storage/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':rn-async-storage')
    

Package Sidebar

Install

npm i rnas

Weekly Downloads

2

Version

1.0.29

License

MIT

Unpacked Size

69.1 kB

Total Files

12

Last publish

Collaborators

  • liewjuntung