Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29610

Cannot resolve method 'getJSModule' in Android

$
0
0

I am using this method in android but it's displaying this error "context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("Heartbeat",null);"

I am importing import com.facebook.react.modules.core.DeviceEventManagerModule; but still the problem remains. Any idea why it displays that? Couldn't find anything on the internet.

Context context = getApplicationContext();
context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("Heartbeat",null);

Viewing all articles
Browse latest Browse all 29610

Trending Articles