List of usage examples for com.facebook.react.bridge WritableNativeMap putString
@Override
public native void putString(@NonNull String key, @Nullable String value);
From source file:com.microsoft.c3p.reactnative.C3PReactModule.java
License:Open Source License
private static WritableNativeMap convertObjectResult(JavaScriptValue objectResult) { WritableNativeMap convertedResult = new WritableNativeMap(); for (Map.Entry<String, JavaScriptValue> entry : objectResult.getObjectEntries()) { String key = entry.getKey(); JavaScriptValue value = entry.getValue(); switch (value.getType()) { case Null: convertedResult.putNull(key); break; case Boolean: convertedResult.putBoolean(key, value.getBoolean()); break; case Number: convertedResult.putDouble(key, value.getDouble()); break; case String: convertedResult.putString(key, value.getString()); break; case Object: convertedResult.putMap(key, C3PReactModule.convertObjectResult(value)); break; case Array: convertedResult.putArray(key, C3PReactModule.convertArrayResult(value)); break; }//from www. j av a2 s. c om } return convertedResult; }
From source file:io.github.douglasjunior.ReactNativeEasyBluetooth.core.CoreModule.java
License:Open Source License
private WritableNativeMap wrapDevice(BluetoothDevice bluetoothDevice, int RSSI) { WritableNativeMap device = new WritableNativeMap(); device.putString("address", bluetoothDevice.getAddress()); device.putString("name", bluetoothDevice.getName()); device.putInt("rssi", RSSI); WritableArray uuids = new WritableNativeArray(); if (bluetoothDevice.getUuids() != null) { for (ParcelUuid uuid : bluetoothDevice.getUuids()) { uuids.pushString(uuid.toString()); }/* www . j a v a 2 s . co m*/ } device.putArray("uuids", uuids); return device; }
From source file:org.jitsi.meet.sdk.invite.InviteController.java
License:Apache License
private boolean invite(String addPeopleControllerScope, ReactContext reactContext, WritableArray invitees) { WritableNativeMap data = new WritableNativeMap(); data.putString("addPeopleControllerScope", addPeopleControllerScope); data.putString("externalAPIScope", externalAPIScope); data.putArray("invitees", invitees); return ReactContextUtils.emitEvent(reactContext, "org.jitsi.meet:features/invite#invite", data); }
From source file:org.jitsi.meet.sdk.invite.InviteController.java
License:Apache License
/** * Starts a query for users to invite to the conference. Results will be * returned through the {@link AddPeopleControllerListener#onReceivedResults(AddPeopleController, List, String)} * method.// w w w . jav a 2 s . com * * @param query {@code String} to use for the query */ void performQuery(AddPeopleController addPeopleController, String query) { WritableNativeMap params = new WritableNativeMap(); params.putString("addPeopleControllerScope", addPeopleController.getUuid()); params.putString("externalAPIScope", externalAPIScope); params.putString("query", query); ReactContextUtils.emitEvent(addPeopleController.getReactApplicationContext(), "org.jitsi.meet:features/invite#performQuery", params); }