Closed amir-yaghoubi closed 6 years ago
WritableMap toWritableMap(JSONObject json){ WritableMap response = Arguments.createMap(); Iteratoriter = json.keys(); while (iter.hasNext()) { String key = iter.next(); try { if (json.get(key) instanceof Integer) { response.putInt(key, (Integer) json.get(key)); } else if (json.get(key) instanceof String) { response.putString(key, (String) json.get(key)); } else if (json.get(key) instanceof JSONObject) { toWritableMap((JSONObject) json.get(key)); } else if (json.get(key) instanceof Double) { response.putDouble(key, (Double) json.get(key)); }else if (json.get(key) instanceof Boolean) { response.putBoolean(key, (Boolean) json.get(key)); } } catch (JSONException e) { // Something went wrong! } } return response; }
public void onEvent(final PushMessage msg)کد زیر رو اضافه کنید مشکل حل میشه
response.putMap("data", toWritableMap(msg.getData()));
Can you please create a PR for your solution @Mr-Hqq ?
@behrad it's done for goodness. Please let me know if I'm wrong!
This issue fixed in this PR #10 and will be available in next version.
I will close this issue since its resolved.
data
به درستیparse
نمیشود که باعث عدم دریافت آن میشود