public final class AsyncStorageModule extends NativeAsyncStorageSpec implements ModuleDataCleaner.Cleanable
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
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, getReactApplicationContextIfActiveOrWarn
canOverrideExistingModule, getConstants, hasConstants, invalidate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invalidate
public 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)
multiGet
in class NativeAsyncStorageSpec
public void multiSet(ReadableArray keyValueArray, Callback callback)
multiSet
in class NativeAsyncStorageSpec
public void multiRemove(ReadableArray keys, Callback callback)
multiRemove
in class NativeAsyncStorageSpec
public void multiMerge(ReadableArray keyValueArray, Callback callback)
multiMerge
in class NativeAsyncStorageSpec
public void clear(Callback callback)
clear
in class NativeAsyncStorageSpec
public void getAllKeys(Callback callback)
getAllKeys
in class NativeAsyncStorageSpec