mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
625 B
Executable File
625 B
Executable File
Native Events
When the native network is switched, or the horizontal/vertical screen display is switched, the native needs to send some global broadcast events to the front-end, so that the front-end can control the service state according to different states.
Native Sending
The native calls the code at the place where the events need to be sent.
HippyMap hippyMap = new HippyMap();
hippyMap.pushString("result", "hello i am from native");
mEngineManager.getCurrentEngineContext()
.getModuleManager()
.getJavaScriptModule(EventDispatcher.class)
.receiveNativeEvent("rotate", hippyMap);