File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
iterableapi/src/main/java/com/iterable/iterableapi Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2424import java .util .Date ;
2525import java .util .List ;
2626import java .util .Map ;
27+ import java .util .Set ;
2728import java .util .TimeZone ;
2829import java .util .regex .Matcher ;
2930import java .util .regex .Pattern ;
@@ -86,6 +87,27 @@ public String getPayloadData(String key) {
8687 return (_payloadData != null ) ? _payloadData .getString (key , null ): null ;
8788 }
8889
90+ /**
91+ * Retrieves all of the payload as a single JSON Object
92+ * @return JSONObject
93+ */
94+
95+ public JSONObject getPayloadData () {
96+ JSONObject json = new JSONObject ();
97+ if (_payloadData == null ) {
98+ return json ;
99+ }
100+ Set <String > keys = _payloadData .keySet ();
101+ try {
102+ for (String key : keys ) {
103+ json .put (key , _payloadData .get (key ));
104+ }
105+ } catch (JSONException e ) {
106+ e .printStackTrace ();
107+ }
108+ return json ;
109+ }
110+
89111 /**
90112 * Returns the attribution information ({@link IterableAttributionInfo}) for last push open
91113 * or app link click from an email.
You can’t perform that action at this time.
0 commit comments