Skip to content

Commit

Permalink
Adding in updateUser api call
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtruong committed Jun 16, 2016
1 parent 8e8de49 commit d2d346d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,20 @@ public void updateEmail(String newEmail) {
_email = newEmail;
}

public void updateUser(JSONObject dataFields) {
JSONObject requestJSON = new JSONObject();

try {
requestJSON.put(IterableConstants.KEY_EMAIL, _email);
requestJSON.put(IterableConstants.KEY_DATAFIELDS, dataFields);
}
catch (JSONException e) {
e.printStackTrace();
}

sendRequest(IterableConstants.ENDPOINT_UPDATEUSER, requestJSON);
}

public void disablePush(String iterableAppId, String gcmProjectId) {
registerForPush(iterableAppId, gcmProjectId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ public final class IterableConstants {
public static final String KEY_USER = "user";
public static final String KEY_ITEMS = "items";
public static final String KEY_TOTAL = "total";


public static final String ENDPOINT_DISABLEDEVICE = "users/disableDevice";
public static final String ENDPOINT_PUSHTARGET = "push/target";
public static final String ENDPOINT_REGISTERDEVICETOKEN = "users/registerDeviceToken";
public static final String ENDPOINT_TRACK = "events/track";
public static final String ENDPOINT_TRACKCONVERSION = "events/trackConversion";
public static final String ENDPOINT_TRACKPURCHASE = "commerce/trackPurchase";
public static final String ENDPOINT_TRACKPUSHOPEN = "events/trackPushOpen";
public static final String ENDPOINT_UPDATEEMAIL = "users/updateEmail";
public static final String ENDPOINT_DISABLEDEVICE = "users/disableDevice";
public static final String ENDPOINT_UPDATEUSER = "users/update";


public static final String PUSH_APPID = "IterableAppId";
public static final String PUSH_PROJECTID = "GCMProjectNumber";
Expand Down

0 comments on commit d2d346d

Please sign in to comment.