fix token parameter to be wrapped in a map when sending to JS

This commit is contained in:
Artal Druk
2020-01-16 16:00:38 +02:00
parent 325e892eae
commit 8c428ebcc7

View File

@@ -88,10 +88,10 @@ public class FcmToken implements IFcmToken {
// Note: Cannot assume react-context exists cause this is an async dispatched service.
if (reactContext != null && reactContext.hasActiveCatalystInstance()) {
HashMap<String, String> h = new HashMap<String, String>() {{
HashMap<String, String> tokenMap = new HashMap<String, String>() {{
put("deviceToken",sToken);
}};
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(TOKEN_RECEIVED_EVENT_NAME, sToken);
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(TOKEN_RECEIVED_EVENT_NAME, tokenMap);
}
}
}