Java Code Examples for com.facebook.react.bridge.WritableNativeArray#pushMap()

The following examples show how to use com.facebook.react.bridge.WritableNativeArray#pushMap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CameraRollModule.java    From rn-camera-roll with MIT License 7 votes vote down vote up
@ReactMethod
public void getCameraImages(ReadableMap data, Callback onSuccess) {
    WritableNativeArray result = new WritableNativeArray();

    for(CameraImage imageData : CameraImagesManager.getCameraImages(this.context,
            data.getInt("first"), data.hasKey("after") ? data.getString("after") : "")) {
        WritableMap imageDataMap = new WritableNativeMap();
        imageDataMap.putString("uri", imageData.getLocalPath());
        imageDataMap.putInt("width", imageData.getWidth());
        imageDataMap.putInt("height", imageData.getHeight());
        imageDataMap.putInt("orientation", imageData.getOrientation());
        imageDataMap.putString("timestamp", Long.toString(imageData.getTimestamp()));

        result.pushMap(imageDataMap);
    }

    onSuccess.invoke(result);
}
 
Example 2
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
@ReactMethod
public void selectStarOrBlackContacts(String pkey, Callback callback) {
    List<Nick> list = IMDatabaseManager.getInstance().selectStarOrBlackContactsAsNick(pkey);
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < list.size(); i++) {
        Nick nick = list.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("Name", TextUtils.isEmpty(nick.getName()) ? nick.getXmppId() : nick.getName());
        map.putString("XmppId", nick.getXmppId());
        map.putString("HeaderUri", TextUtils.isEmpty(nick.getHeaderSrc()) ? defaultUserImage : nick.getHeaderSrc());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("data", array);
    callback.invoke(re);
}
 
Example 3
Source File: JSONEncoder.java    From react-native-google-fitness with MIT License 6 votes vote down vote up
public static WritableNativeArray convertDataSet(DataSet dataSet) {
    WritableNativeArray jsonDataSet = new WritableNativeArray();
    for (DataPoint dp : dataSet.getDataPoints()) {
        WritableNativeMap jsonDataPoint = new WritableNativeMap();

        jsonDataPoint.putString("type", dp.getDataType().getName());
        jsonDataPoint.putString("source", dp.getOriginalDataSource().getAppPackageName());
        jsonDataPoint.putString("start", dateFormat.format(dp.getStartTime(TimeUnit.MILLISECONDS)));
        jsonDataPoint.putString("end", dateFormat.format(dp.getEndTime(TimeUnit.MILLISECONDS)));

        WritableNativeArray jsonFieldValuePairs = new WritableNativeArray();
        for (Field field : dp.getDataType().getFields()) {
            WritableNativeMap jsonFieldValuePair = new WritableNativeMap();
            jsonFieldValuePair.putString("field", field.getName());
            jsonFieldValuePair.putString("value", dp.getValue(field).toString());
            jsonFieldValuePairs.pushMap(jsonFieldValuePair);
        }
        jsonDataPoint.putArray("fields", jsonFieldValuePairs);

        jsonDataSet.pushMap(jsonDataPoint);
    }
    return jsonDataSet;
}
 
Example 4
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
/**
 * 获取日历功能区域列表
 *
 * @param callback
 */
@ReactMethod
public void getTripArea(Callback callback) {
    List<AreaLocal.DataBean.ListBean> list = IMDatabaseManager.getInstance().getAreaList();
    WritableNativeMap map = new WritableNativeMap();
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < list.size(); i++) {
        WritableNativeMap item = new WritableNativeMap();
        item.putString("AddressName", list.get(i).getAreaName());
        item.putInt("AddressNumber", list.get(i).getAreaID());
        item.putString("rStartTime", list.get(i).getMorningStarts());
        item.putString("rEndTime", list.get(i).getEveningEnds());
        array.pushMap(item);
    }
    map.putBoolean("ok", true);
    map.putArray("areaList", array);
    callback.invoke(map);


}
 
Example 5
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
/**
 * 获取日历功能城市列表
 *
 * @param callback
 */
@ReactMethod
public void getTripCity(Callback callback) {

    List<CityLocal.DataBean> list = IMDatabaseManager.getInstance().getCityList();
    WritableNativeMap map = new WritableNativeMap();
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < list.size(); i++) {
        WritableNativeMap item = new WritableNativeMap();
        item.putString("CityName", list.get(i).getCityName());
        item.putInt("CityId", list.get(i).getId());
        array.pushMap(item);
    }
    map.putBoolean("ok", true);
    map.putArray("cityList", array);
    callback.invoke(map);

}
 
Example 6
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
@ReactMethod
public void searchFilesByXmppId(String xmppid, Callback callback) {
    WritableNativeArray writableNativeArray = new WritableNativeArray();
    JSONArray jsonArray = ConnectionUtil.getInstance().searchFilesMsgByXmppid(xmppid);
    for (int i = 0; i < jsonArray.length(); i++) {
        try {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            WritableNativeMap writableNativeMap = new WritableNativeMap();
            writableNativeMap.putString("from", jsonObject.optString("from"));
            writableNativeMap.putString("content", jsonObject.optString("content"));
            writableNativeMap.putString("time", jsonObject.optString("time"));
            writableNativeMap.putString("name", jsonObject.optString("name"));
            writableNativeMap.putString("headerSrc", jsonObject.optString("headerSrc"));
            writableNativeArray.pushMap(writableNativeMap);
        } catch (JSONException e) {
            e.printStackTrace();
        }

    }
    if (callback != null) {
        WritableNativeMap map = new WritableNativeMap();
        map.putArray("files", writableNativeArray);
        callback.invoke(map);
    }
}
 
Example 7
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
@ReactMethod
public void selectUserNotInStartContacts(String key, Callback callback) {
    List<Nick> list = IMDatabaseManager.getInstance().selectUserNotInStartContacts(key);
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < list.size(); i++) {
        Nick nick = list.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("Name", TextUtils.isEmpty(nick.getName()) ? nick.getXmppId() : nick.getName());
        map.putString("XmppId", nick.getXmppId());
        map.putString("HeaderUri", TextUtils.isEmpty(nick.getHeaderSrc()) ? defaultUserImage : nick.getHeaderSrc());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("users", array);
    callback.invoke(re);
}
 
Example 8
Source File: NotificationModule.java    From things-notification with Apache License 2.0 6 votes vote down vote up
@ReactMethod
public void getInstalledApps(Promise promise) {
    WritableNativeArray params = new WritableNativeArray();
    PackageManager pm = reactContext.getPackageManager();
    List<ApplicationInfo> apps = pm.getInstalledApplications(0);
    for(ApplicationInfo app : apps) {
        if ((pm.getLaunchIntentForPackage(app.packageName) != null) &&
                !thisApp.equals(app.packageName)) {
            WritableNativeMap param = new WritableNativeMap();
            String appName = app.loadLabel(pm).toString();
            String appPackage = app.packageName;
            String appIcon = saveIcon(appPackage, app.loadIcon(pm));
            //Log.d(TAG, "name: "+appName);
            //Log.d(TAG, "app: "+appPackage);
            //Log.d(TAG, "icon: "+appIcon);
            param.putString("name", appName);
            param.putString("app", appPackage);
            param.putString("icon", appIcon);
            //sendEvent("installedApps", param);
            params.pushMap(param);
        }
    }
    promise.resolve(params);
}
 
Example 9
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
@ReactMethod
public void selectMemberFromGroup(ReadableMap params, Callback callback) {
    String groupId = params.getString("groupId");
    String searchText = params.getString("searchText");
    List<Nick> userList = ConnectionUtil.getInstance().selectMemberFromGroup(groupId, searchText);
    WritableNativeArray array = new WritableNativeArray();

    for (int i = 0; i < userList.size(); i++) {
        Nick nick = userList.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("name", TextUtils.isEmpty(nick.getName()) ? nick.getXmppId() : nick.getName());
        map.putString("xmppId", nick.getXmppId());
        map.putString("headerUri", TextUtils.isEmpty(nick.getHeaderSrc()) ? defaultUserImage : nick.getHeaderSrc());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("UserList", array);
    re.putBoolean("ok", true);
    callback.invoke(re);
}
 
Example 10
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
@ReactMethod
public void selectGroupMemberForKick(ReadableMap params, Callback callback) {
    String groupId = params.getString("groupId");
    List<Nick> userList = ConnectionUtil.getInstance().selectGroupMemberForKick(groupId);
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < userList.size(); i++) {
        Nick nick = userList.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("name", TextUtils.isEmpty(nick.getName()) ? nick.getXmppId() : nick.getName());
        map.putString("xmppId", nick.getXmppId());
        map.putString("headerUri", TextUtils.isEmpty(nick.getHeaderSrc()) ? defaultUserImage : nick.getHeaderSrc());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("UserList", array);
    re.putBoolean("ok", true);
    callback.invoke(re);
}
 
Example 11
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
/**
 * 根据文字搜索联系人
 *
 * @param params
 * @param callback
 */
@ReactMethod
public void selectUserListByText(ReadableMap params, Callback callback) {
    String groupId = params.getString("groupId");
    String searchText = params.getString("searchText");
    List<Nick> userList = ConnectionUtil.getInstance().SelectUserListBySearchText(groupId, searchText);
    WritableNativeArray array = new WritableNativeArray();

    for (int i = 0; i < userList.size(); i++) {
        Nick nick = userList.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("name", TextUtils.isEmpty(nick.getName()) ? nick.getXmppId() : nick.getName());
        map.putString("xmppId", nick.getXmppId());
        map.putString("headerUri", TextUtils.isEmpty(nick.getHeaderSrc()) ? defaultUserImage : nick.getHeaderSrc());
        map.putBoolean("hasInGroup", nick.isInGroup());
        map.putString("desc",nick.getDescInfo());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("UserList", array);
    re.putBoolean("ok", true);
    callback.invoke(re);
}
 
Example 12
Source File: QimRNBModule.java    From imsdk-android with MIT License 6 votes vote down vote up
/**
 * 获取群列表
 *
 * @param callback
 */
@ReactMethod
public void getGroupList(Callback callback) {
    List<Nick> nickList = ConnectionUtil.getInstance().SelectAllGroup();
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < nickList.size(); i++) {
        Nick n = nickList.get(i);
        WritableNativeMap map = new WritableNativeMap();
        map.putString("title", n.getName());
        map.putString("GroupId", n.getGroupId());
        String url = n.getHeaderSrc();
        if (TextUtils.isEmpty(url)) {
            url = defaultMucImage;
        }
        map.putString("HeaderUri", url);
        map.putString("Name", n.getName());
        array.pushMap(map);
    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("groupList", array);
    callback.invoke(re);
}
 
Example 13
Source File: QimRNBModule.java    From imsdk-android with MIT License 5 votes vote down vote up
public void getGroupMemberFromDB(String groupId, Callback callback) {
    List<GroupMember> groupMemberList = ConnectionUtil.getInstance().SelectGroupMemberByGroupId(groupId);
    if (ListUtil.isEmpty(groupMemberList)) {
        return;
    }
    WritableNativeArray array = new WritableNativeArray();
    int per = 2;
    for (int i = 0; i < groupMemberList.size(); i++) {
        GroupMember gm = groupMemberList.get(i);
        WritableNativeMap map = new WritableNativeMap();
        String affiliation = gm.getAffiliation();
        map.putString("affiliation", affiliation);
        map.putString("headerUri", TextUtils.isEmpty(gm.getHeaderSrc()) ? defaultUserImage : gm.getHeaderSrc());
        String xmppid = gm.getMemberId();
        if (CurrentPreference.getInstance().getPreferenceUserId().equals(xmppid)) {
            if (!TextUtils.isEmpty(affiliation)) {
                per = Integer.parseInt(affiliation);
            }
        }
        map.putString("xmppjid", xmppid);
        map.putString("jid", gm.getGroupId());
        map.putString("name", gm.getName());
        array.pushMap(map);

    }
    WritableNativeMap re = new WritableNativeMap();
    re.putArray("GroupMembers", array);
    re.putBoolean("ok", true);
    re.putString("GroupId", groupId);
    re.putInt("permissions", per);
    if (callback != null) {
        callback.invoke(re);
    } else {
        sendEvent("updateGroupMember", re);
    }
}
 
Example 14
Source File: QtalkPlugin.java    From imsdk-android with MIT License 5 votes vote down vote up
private WritableNativeMap parseFound(FoundConfiguration foundConfiguration) {
    WritableNativeMap map = new WritableNativeMap();
    WritableNativeArray groupList = new WritableNativeArray();
    for (int i = 0; i < foundConfiguration.getData().size(); i++) {
        FoundConfiguration.DataBean data = foundConfiguration.getData().get(i);
        WritableNativeMap item = new WritableNativeMap();
        item.putString("groupIcon", data.getGroupIcon());
        item.putInt("groupId", data.getGroupId());
        item.putString("groupName", data.getGroupName());
        WritableNativeArray array = new WritableNativeArray();
        for (int j = 0; j < data.getMembers().size(); j++) {
            FoundConfiguration.DataBean.MembersBean membersBean = data.getMembers().get(j);
            WritableNativeMap mem = new WritableNativeMap();
            mem.putString("memberAction", membersBean.getMemberAction());
            mem.putString("memberIcon", membersBean.getMemberIcon());
            mem.putString("memberName", membersBean.getMemberName());
            mem.putInt("memberId", membersBean.getMemberId());
            mem.putString("Entrance", membersBean.getEntrance());
            mem.putString("Bundle", membersBean.getBundle());
            mem.putString("Version", membersBean.getVersion() + "");
            mem.putString("BundleUrls", membersBean.getBundleUrls());
            mem.putString("Module", membersBean.getModule());
            mem.putString("AppType", membersBean.getAppType() + "");
            mem.putBoolean("showNativeNav", membersBean.isShowNativeNav());
            mem.putString("navTitle", membersBean.getNavTitle());
            mem.putString("appParams", membersBean.getProperties());
            array.pushMap(mem);
        }
        item.putArray("members", array);
        groupList.pushMap(item);
    }
    map.putBoolean("isOk", true);
    map.putArray("data", groupList);

    return map;
}
 
Example 15
Source File: CatalystNativeJavaToJSArgumentsTestCase.java    From react-native-GPay with MIT License 5 votes vote down vote up
public void testThrowWhenMapReusedInArray() {
  boolean gotException = false;
  try {
    WritableNativeArray array1 = new WritableNativeArray();
    WritableNativeArray array2 = new WritableNativeArray();
    WritableNativeMap child = new WritableNativeMap();
    array1.pushMap(child);
    array2.pushMap(child);
  } catch (ObjectAlreadyConsumedException e) {
    gotException = true;
  }
  assertTrue(gotException);
}
 
Example 16
Source File: QimRNBModule.java    From imsdk-android with MIT License 5 votes vote down vote up
/**
 * 格式化行程对象为rn map对象
 *
 * @param bean
 * @return
 */

public WritableNativeMap getRNDataByTrip(CalendarTrip.DataBean.TripsBean bean) {
    WritableNativeMap map = new WritableNativeMap();
    map.putString("beginTime", bean.getBeginTime());
    map.putString("endTime", bean.getEndTime());
    map.putString("scheduleTime", bean.getScheduleTime());
    map.putString("tripType", bean.getTripType());
    map.putString("appointment", bean.getAppointment());
    map.putString("tripDate", bean.getTripDate());
    map.putString("tripId", bean.getTripId());
    map.putString("tripIntr", bean.getTripIntr());
    map.putString("tripInviter", bean.getTripInviter());
    map.putString("tripLocale", bean.getTripLocale());
    map.putString("tripLocaleNumber", bean.getTripLocaleNumber());
    map.putString("tripName", bean.getTripName());
    map.putString("tripRemark", bean.getTripRemark());
    map.putString("tripRoomNumber", bean.getTripRoomNumber());
    map.putString("tripRoom", bean.getTripRoom());
    WritableNativeArray members = new WritableNativeArray();
    for (int i = 0; i < bean.getMemberList().size(); i++) {
        CalendarTrip.DataBean.TripsBean.MemberListBean mb = bean.getMemberList().get(i);

        WritableNativeMap member = new WritableNativeMap();
        member.putString("memberId", mb.getMemberId());
        member.putString("memberState", mb.getMemberState());
        member.putString("memberStateDescribe", mb.getMemberStateDescribe());
        Nick nick = ConnectionUtil.getInstance().getNickById(mb.getMemberId());
        member.putString("memberName", nick.getName());
        member.putString("headerUrl", nick.getHeaderSrc());
        members.pushMap(member);
    }
    map.putArray("memberList", members);


    return map;
}
 
Example 17
Source File: CatalystNativeJavaToJSArgumentsTestCase.java    From react-native-GPay with MIT License 5 votes vote down vote up
public void testArrayWithMaps() {
  WritableNativeMap m1 = new WritableNativeMap();
  WritableNativeMap m2 = new WritableNativeMap();
  m1.putString("m1k1", "m1v1");
  m1.putString("m1k2", "m1v2");
  m2.putString("m2k1", "m2v1");

  WritableNativeArray array = new WritableNativeArray();
  array.pushMap(m1);
  array.pushMap(m2);
  mInstance.getJSModule(TestJavaToJSArgumentsModule.class).receiveArrayWithMaps(array);
  waitForBridgeAndUIIdle();
  mAssertModule.verifyAssertsAndReset();
}
 
Example 18
Source File: QimRNBModule.java    From imsdk-android with MIT License 5 votes vote down vote up
public WritableNativeArray parseUserMedalData(List<MedalsInfo> list) {
    WritableNativeArray array = new WritableNativeArray();
    for (int i = 0; i < list.size(); i++) {
        MedalsInfo medalsInfo = list.get(i);
        WritableNativeMap item = new WritableNativeMap();
        item.putString("UserId", medalsInfo.getXmppId());
        item.putString("type", medalsInfo.getType());
        item.putString("url", medalsInfo.getUrl());
        item.putString("desc", medalsInfo.getDesc());
        item.putString("LastUpdateTime", medalsInfo.getUpt());
        array.pushMap(item);
    }
    return array;
}
 
Example 19
Source File: QimRNBModule.java    From imsdk-android with MIT License 4 votes vote down vote up
/************************** Search start************************/

    @ReactMethod
    public void searchLocalMessageByKeyword(String keyword, String xmppid, String realjid, Callback callback) {
        try {
            WritableNativeArray writableNativeArray = new WritableNativeArray();
            JSONArray list = IMDatabaseManager.getInstance().selectMessageByKeyWord(keyword, xmppid, realjid);
            Map<String, List<JSONObject>> map = new LinkedHashMap<>();
            for (int i = 0; i < list.length(); i++) {
                JSONObject imMessage = list.getJSONObject(i);
                String timeStr = getTimeStr(imMessage.getLong("timeLong"));
                List<JSONObject> oldList = map.get(timeStr);
                if (oldList != null) {
                    oldList.add(imMessage);
                } else {
                    List<JSONObject> newList = new ArrayList<>();
                    newList.add(imMessage);
                    map.put(timeStr, newList);

                }
            }

            WritableNativeMap cMap = new WritableNativeMap();
            WritableNativeArray array = new WritableNativeArray();
            for (Map.Entry<String, List<JSONObject>> entry : map.entrySet()) {
                WritableNativeArray itemArray = new WritableNativeArray();
                for (int i = 0; i < entry.getValue().size(); i++) {
                    JSONObject jsonObject = entry.getValue().get(i);
                    WritableNativeMap writableNativeMap = new WritableNativeMap();
                    writableNativeMap.putString("time", jsonObject.optString("time"));
                    writableNativeMap.putString("timeLong", jsonObject.optString("timeLong"));
                    writableNativeMap.putString("content", jsonObject.optString("content"));
                    writableNativeMap.putString("nickName", jsonObject.optString("nickName"));
                    writableNativeMap.putString("headerUrl", jsonObject.optString("headerUrl"));
                    writableNativeMap.putString("msgId", jsonObject.optString("msgId"));
                    writableNativeMap.putString("from", jsonObject.optString("from"));
                    itemArray.pushMap(writableNativeMap);
                }
                WritableNativeMap itemMap = new WritableNativeMap();
                itemMap.putArray("data", itemArray);
                itemMap.putString("key", entry.getKey());
                array.pushMap(itemMap);

            }
            cMap.putBoolean("ok", true);
            cMap.putArray("data", array);
            callback.invoke(cMap);


        } catch (Exception e) {
            Logger.i("会话内搜索:" + e.getMessage());
        }

    }
 
Example 20
Source File: QimRNBModule.java    From imsdk-android with MIT License 4 votes vote down vote up
/**
     * 查询用户的行车根据 整月查询
     *
     * @param params
     * @param callback
     */
    @ReactMethod
    public void selectUserTripByDate(ReadableMap params, Callback callback) {
        String date = params.getString("showDate");
        List<CalendarTrip.DataBean.TripsBean> list = IMDatabaseManager.getInstance().SelectTripByYearMonth(date);
        Collections.sort(list, new Comparator<CalendarTrip.DataBean.TripsBean>() {
            @Override
            public int compare(CalendarTrip.DataBean.TripsBean lhs, CalendarTrip.DataBean.TripsBean rhs) {
                try {
                    if (DateUtil.string2Time(lhs.getBeginTime()).getTime() > DateUtil.string2Time(rhs.getBeginTime()).getTime()) {
                        return 1;
                    }
                    if (DateUtil.string2Time(lhs.getBeginTime()).getTime() < DateUtil.string2Time(rhs.getBeginTime()).getTime()) {
                        return -1;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return 0;
            }
        });
        WritableNativeMap map = new WritableNativeMap();
        WritableNativeMap dataMap = new WritableNativeMap();
        WritableNativeMap.setUseNativeAccessor(true);
        WritableNativeArray.setUseNativeAccessor(true);
        Map<String, List<WritableNativeMap>> localMap = new HashMap<>();

//        map.putBoolean("ok", true);

        for (int i = 0; i < list.size(); i++) {
            CalendarTrip.DataBean.TripsBean bean = list.get(i);
            if (!localMap.containsKey(bean.getTripDate())) {
//                WritableNativeArray newArray = new WritableNativeArray();
                List<WritableNativeMap> newArray = new ArrayList<>();
                newArray.add(getRNDataByTrip(bean));
                localMap.put(bean.getTripDate(), newArray);

            } else {
                List<WritableNativeMap> lastArray = localMap.get(bean.getTripDate());
                lastArray.add(getRNDataByTrip(bean));
                localMap.put(bean.getTripDate(), lastArray);
            }

        }

        for (Map.Entry<String, List<WritableNativeMap>> entry : localMap.entrySet()) {
            WritableNativeArray array = new WritableNativeArray();
            for (int i = 0; i < entry.getValue().size(); i++) {
                array.pushMap(entry.getValue().get(i));
            }
            dataMap.putArray(entry.getKey(), array);
        }


        map.putBoolean("ok", true);
        map.putMap("data", dataMap);
        callback.invoke(map);

    }