You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BALogger.public(domain: loggerDomain, message:"Cannot identify, Custom ID is blocklisted: `\(customID)`. Please ensure you have correctly implemented the API.")
69
+
return
70
+
}
66
71
}
67
72
68
73
// Compatibility
@@ -200,7 +205,7 @@ public class BAProfileCenter: NSObject, BAProfileCenterProtocol {
@@ -114,18 +119,18 @@ public class BATProfileEditor: NSObject, BATSerializableProfileEditorProtocol, N
114
119
publicfunc setEmail(_ value:String?)throws{
115
120
trycheckIfConsumed()
116
121
122
+
if !isProfileIdentified(){
123
+
throwBatchProfileError(code:.editorInvalidValue, reason:"Emails cannot be set on a profile if it has not been identified first. Please call 'BatchProfile.idenfity()' with a non nil value beforehand.")
124
+
}
125
+
117
126
iflet value {
118
127
letbaseError="Cannot set email address:"
119
128
120
-
if !canSetEmail(){
121
-
throwBatchProfileError(code:.editorInvalidValue, reason:"Emails cannot be set on a profile if it has not been identified first. Please call 'BatchProfile.idenfity()' with a non nil value beforehand.")
122
-
}
123
-
124
-
if value.count >Maximums.emailLength {
125
-
throwBatchProfileError(code:.editorInvalidValue, reason:"\(baseError) address cannot be longer than \(Maximums.emailLength) characters")
129
+
ifBATProfileDataValidators.isEmailTooLong(value){
130
+
throwBatchProfileError(code:.editorInvalidValue, reason:"\(baseError) address cannot be longer than \(BATProfileDataValidators.emailMaxLength) characters")
@@ -145,6 +150,34 @@ public class BATProfileEditor: NSObject, BATSerializableProfileEditorProtocol, N
145
150
}
146
151
}
147
152
153
+
@objc
154
+
publicfunc setPhoneNumber(_ value:String?)throws{
155
+
trycheckIfConsumed()
156
+
157
+
if !isProfileIdentified(){
158
+
throwBatchProfileError(code:.editorInvalidValue, reason:"Phone number cannot be set on a profile if it has not been identified first. Please call 'BatchProfile.idenfity()' with a non nil value beforehand.")
159
+
}
160
+
161
+
iflet value {
162
+
if !BATProfileDataValidators.isValidPhoneNumber(value){
163
+
throwBatchProfileError(code:.editorInvalidValue, reason:"Invalid phone number. Please make sure that the string starts with a `+` and is no longer than 15 digits.")
0 commit comments