-
- All Implemented Interfaces:
-
com.facebook.react.bridge.LifecycleEventListener,com.facebook.react.bridge.NativeModule,com.facebook.react.bridge.ReactModuleWithSpec,com.facebook.react.bridge.WindowFocusChangeListener,com.facebook.react.turbomodule.core.interfaces.TurboModule
public class AppStateModule extends NativeAppStateSpec implements LifecycleEventListener, WindowFocusChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringTAGpublic final static StringNAMEpublic final static StringAPP_STATE_ACTIVEpublic final static StringAPP_STATE_BACKGROUND
-
Constructor Summary
Constructors Constructor Description AppStateModule(ReactApplicationContext reactContext)
-
Method Summary
Modifier and Type Method Description StringgetName()Map<String, Object>getTypedExportedConstants()voidgetCurrentAppState(Callback success, Callback error)voidonHostResume()Called either when the host activity receives a resume event (e.g. voidonHostPause()Called when host activity receives pause event (e.g. voidonHostDestroy()Called when host activity receives destroy event (e.g. voidonWindowFocusChange(boolean hasFocus)voidaddListener(String eventName)voidremoveListeners(double count)voidinvalidate()The CatalystInstance is going away with Venice. -
Methods inherited from class com.facebook.fbreact.specs.NativeAppStateSpec
getConstants -
Methods inherited from class com.facebook.react.bridge.BaseJavaModule
canOverrideExistingModule, hasConstants, initialize, onCatalystInstanceDestroy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AppStateModule
AppStateModule(ReactApplicationContext reactContext)
-
-
Method Detail
-
getTypedExportedConstants
Map<String, Object> getTypedExportedConstants()
-
getCurrentAppState
void getCurrentAppState(Callback success, Callback error)
-
onHostResume
void onHostResume()
Called either when the host activity receives a resume event (e.g. onResume orif the native module that implements this is initialized while the host activity is alreadyresumed. Always called for the most current activity.
-
onHostPause
void onHostPause()
Called when host activity receives pause event (e.g. onPause. Always calledfor the most current activity.
-
onHostDestroy
void onHostDestroy()
Called when host activity receives destroy event (e.g. onDestroy. Only calledfor the last React activity to be destroyed.
-
onWindowFocusChange
void onWindowFocusChange(boolean hasFocus)
-
addListener
void addListener(String eventName)
-
removeListeners
void removeListeners(double count)
-
invalidate
void invalidate()
The CatalystInstance is going away with Venice. Therefore, the TurboModule infra introduces theinvalidate() method to allow NativeModules to clean up after themselves.
-
-
-
-