Thax @jesse
you mean send ‘JS Component View Open Event’ message to js?
it is my fault to open js component at android service,
now i am success to receive screen off event
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF))
{
if(telephonyManager == null)
{
telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);
}
if(isPhoneIdle)
{
WritableMap params = Arguments.createMap();
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("LockScreenOpen", params);
}
}
}
DeviceEventEmitter.addListener('LockScreenOpen', function(e: Event) {
// handle event.
console.log("== Debug: Received LockScreen View Open");
});
but JS Listener need to background service
so now i am solving a problem
is any advice?