public final class AsyncStorageModule extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
AsyncStorageModule(ReactApplicationContext reactContext) |
Modifier and Type | Method and Description |
---|---|
void |
clear(Callback callback)
Clears the database.
|
void |
clearSensitiveData() |
void |
getAllKeys(Callback callback)
Returns an array with all keys from the database.
|
java.lang.String |
getName() |
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules. |
void |
multiGet(ReadableArray keys,
Callback callback)
Given an array of keys, this returns a map of (key, value) pairs for the keys found, and
(key, null) for the keys that haven't been found.
|
void |
multiMerge(ReadableArray keyValueArray,
Callback callback)
Given an array of (key, value) pairs, this will merge the given values with the stored values
of the given keys, if they exist.
|
void |
multiRemove(ReadableArray keys,
Callback callback)
Removes all rows of the keys given.
|
void |
multiSet(ReadableArray keyValueArray,
Callback callback)
Inserts multiple (key, value) pairs.
|
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
getCurrentActivity, getReactApplicationContext
canOverrideExistingModule, getConstants, hasConstants
protected static final java.lang.String NAME
public AsyncStorageModule(ReactApplicationContext reactContext)
public java.lang.String getName()
getName
in interface NativeModule
require()
this module
from javascript.public void initialize()
NativeModule
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules.initialize
in interface NativeModule
initialize
in class BaseJavaModule
public void onCatalystInstanceDestroy()
NativeModule
onCatalystInstanceDestroy
in interface NativeModule
onCatalystInstanceDestroy
in class BaseJavaModule
public void clearSensitiveData()
clearSensitiveData
in interface ModuleDataCleaner.Cleanable
public void multiGet(ReadableArray keys, Callback callback)
public void multiSet(ReadableArray keyValueArray, Callback callback)
public void multiRemove(ReadableArray keys, Callback callback)
public void multiMerge(ReadableArray keyValueArray, Callback callback)
public void clear(Callback callback)
public void getAllKeys(Callback callback)