File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
AndroidSDK/src/com/leanplum Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 2626
2727import com .leanplum .internal .CollectionUtil ;
2828import com .leanplum .internal .Constants ;
29+ import com .leanplum .internal .JsonConverter ;
2930import com .leanplum .internal .Log ;
3031import com .leanplum .internal .Request ;
3132import com .leanplum .internal .Util ;
@@ -110,11 +111,10 @@ public Uri getImageUrl() {
110111 public JSONObject getData () {
111112 JSONObject object = null ;
112113 try {
113- String dataString = getContext ().stringNamed (Constants .Keys .DATA );
114- if (!TextUtils .isEmpty (dataString )) {
115- object = new JSONObject (dataString );
116- }
117- } catch (Exception e ) {
114+ Map <String , ?> mapData =
115+ CollectionUtil .uncheckedCast (getContext ().objectNamed (Constants .Keys .DATA ));
116+ object = JsonConverter .mapToJsonObject (mapData );
117+ } catch (Throwable t ) {
118118 Log .w ("Unable to parse JSONObject for Data field of inbox message." );
119119 }
120120 return object ;
@@ -127,7 +127,6 @@ public String getMessageId() {
127127 return messageId ;
128128 }
129129
130-
131130 /**
132131 * Returns the title of the inbox message.
133132 */
@@ -293,5 +292,4 @@ private Map<String, Object> actionArgs() {
293292 private void setIsRead (boolean isRead ) {
294293 this .isRead = isRead ;
295294 }
296-
297295}
You can’t perform that action at this time.
0 commit comments