@@ -1156,10 +1156,9 @@ private static void registerUserTask() throws JSONException {
1156
1156
}
1157
1157
1158
1158
/**
1159
- * Sync hashed email if you have a login system or collect it from the user. It will be used to
1160
- * reach the user at the most optimal time of the day.
1161
- * @param email the email that you want to sync with the user
1159
+ * @deprecated Please migrate to setEmail. This will be removed in next major release
1162
1160
*/
1161
+ @ Deprecated
1163
1162
public static void syncHashedEmail (final String email ) {
1164
1163
if (!OSUtils .isValidEmail (email ))
1165
1164
return ;
@@ -1202,7 +1201,7 @@ public static void setEmail(@NonNull final String email, @Nullable final String
1202
1201
* the user logs into your app.
1203
1202
* DO NOT generate this from your app!
1204
1203
* Omit this value if you do not have a backend to authenticate the user.
1205
- * @param callback Fire onSucces or onFailure if the update fails or successes.
1204
+ * @param callback Fire onSuccess or onFailure depending if the update successes or fails
1206
1205
*/
1207
1206
public static void setEmail (@ NonNull final String email , @ Nullable final String emailAuthHash , @ Nullable EmailUpdateHandler callback ) {
1208
1207
if (!OSUtils .isValidEmail (email )) {
@@ -1227,8 +1226,13 @@ public static void setEmail(@NonNull final String email, @Nullable final String
1227
1226
@ Override
1228
1227
public void run () {
1229
1228
String trimmedEmail = email .trim ();
1229
+
1230
+ String internalEmailAuthHash = emailAuthHash ;
1231
+ if (internalEmailAuthHash != null )
1232
+ internalEmailAuthHash .toLowerCase ();
1233
+
1230
1234
getCurrentEmailSubscriptionState (appContext ).setEmailAddress (trimmedEmail );
1231
- OneSignalStateSynchronizer .setEmail (trimmedEmail .toLowerCase (), emailAuthHash );
1235
+ OneSignalStateSynchronizer .setEmail (trimmedEmail .toLowerCase (), internalEmailAuthHash );
1232
1236
}
1233
1237
};
1234
1238
0 commit comments