@@ -925,25 +925,72 @@ public void trackPurchase(double total, @NonNull List<CommerceItem> items, @Null
925
925
* @param newEmail New email
926
926
*/
927
927
public void updateEmail (final @ NonNull String newEmail ) {
928
- updateEmail (newEmail , null , null , null );
928
+ updateEmail (newEmail , null , null , null , null );
929
929
}
930
930
931
+ /**
932
+ * Updates the current user's email.
933
+ * Also updates the current email in this IterableAPI instance if the API call was successful.
934
+ * @param newEmail New email
935
+ * @param merge Merge user profiles in email-based projects if set.
936
+ */
937
+ public void updateEmail (final @ NonNull String newEmail , final @ Nullable Boolean merge ) {
938
+ updateEmail (newEmail , merge , null , null , null );
939
+ }
940
+
941
+ /**
942
+ * Updates the current user's email.
943
+ * Also updates the current email in this IterableAPI instance if the API call was successful.
944
+ * @param newEmail New email
945
+ * @param authToken Authentication token
946
+ */
931
947
public void updateEmail (final @ NonNull String newEmail , final @ NonNull String authToken ) {
932
- updateEmail (newEmail , authToken , null , null );
948
+ updateEmail (newEmail , null , authToken , null , null );
933
949
}
934
950
951
+ /**
952
+ * Updates the current user's email.
953
+ * Also updates the current email in this IterableAPI instance if the API call was successful.
954
+ * @param newEmail New email
955
+ * @param merge Merge user profiles in email-based projects if set.
956
+ * @param authToken Authentication token
957
+ */
958
+ public void updateEmail (final @ NonNull String newEmail , final @ Nullable Boolean merge , final @ NonNull String authToken ) {
959
+ updateEmail (newEmail , merge , authToken , null , null );
960
+ }
961
+
962
+ /**
963
+ * Updates the current user's email.
964
+ * Also updates the current email in this IterableAPI instance if the API call was successful.
965
+ * @param newEmail New email
966
+ * @param successHandler Success handler. Called when the server returns a success code.
967
+ * @param failureHandler Failure handler. Called when the server call failed.
968
+ */
935
969
public void updateEmail (final @ NonNull String newEmail , final @ Nullable IterableHelper .SuccessHandler successHandler , @ Nullable IterableHelper .FailureHandler failureHandler ) {
936
- updateEmail (newEmail , null , successHandler , failureHandler );
970
+ updateEmail (newEmail , null , null , successHandler , failureHandler );
971
+ }
972
+
973
+ /**
974
+ * Updates the current user's email.
975
+ * Also updates the current email in this IterableAPI instance if the API call was successful.
976
+ * @param newEmail New email
977
+ * @param merge Merge user profiles in email-based projects if set.
978
+ * @param successHandler Success handler. Called when the server returns a success code.
979
+ * @param failureHandler Failure handler. Called when the server call failed.
980
+ */
981
+ public void updateEmail (final @ NonNull String newEmail , final @ Nullable Boolean merge , final @ Nullable IterableHelper .SuccessHandler successHandler , @ Nullable IterableHelper .FailureHandler failureHandler ) {
982
+ updateEmail (newEmail , merge , null , successHandler , failureHandler );
937
983
}
938
984
939
985
/**
940
986
* Updates the current user's email.
941
987
* Also updates the current email and authToken in this IterableAPI instance if the API call was successful.
942
988
* @param newEmail New email
989
+ * @param merge Optional. Merge user profiles in email-based projects if set.
943
990
* @param successHandler Success handler. Called when the server returns a success code.
944
991
* @param failureHandler Failure handler. Called when the server call failed.
945
992
*/
946
- public void updateEmail (final @ NonNull String newEmail , final @ Nullable String authToken , final @ Nullable IterableHelper .SuccessHandler successHandler , @ Nullable IterableHelper .FailureHandler failureHandler ) {
993
+ public void updateEmail (final @ NonNull String newEmail , final @ Nullable Boolean merge , final @ Nullable String authToken , final @ Nullable IterableHelper .SuccessHandler successHandler , @ Nullable IterableHelper .FailureHandler failureHandler ) {
947
994
if (!checkSDKInitialization ()) {
948
995
IterableLogger .e (TAG , "The Iterable SDK must be initialized with email or userId before " +
949
996
"calling updateEmail" );
@@ -955,7 +1002,7 @@ public void updateEmail(final @NonNull String newEmail, final @Nullable String a
955
1002
return ;
956
1003
}
957
1004
958
- apiClient .updateEmail (newEmail , new IterableHelper .SuccessHandler () {
1005
+ apiClient .updateEmail (newEmail , merge , new IterableHelper .SuccessHandler () {
959
1006
@ Override
960
1007
public void onSuccess (@ NonNull JSONObject data ) {
961
1008
if (_email != null ) {
0 commit comments