【发布时间】:2017-01-11 03:48:15
【问题描述】:
当我尝试将 JSONObject 推送到数据流上时,我已经正确构建了 JSONObject,但随后我尝试将其发布到流中,它为空。
JSONObject position = new JSONObject();
try {
position.put("lat", location.getLatitude());
position.put("lng", location.getLongitude());
} catch (JSONException e) {
System.out.println("json not work");
e.printStackTrace();
}
System.out.println(position) //result: {"lat":37,"lng":-122}
pubNub.publish().message(position)//never sent, if other type it works
【问题讨论】:
-
从未发送过,如果其他类型有效??详细解释一下