@@ -146,11 +146,11 @@ export declare namespace BatchSDK {
146
146
* - Prevent batch.start()
147
147
* - Disable any network capability from the SDK
148
148
* - Disable all In-App campaigns
149
- * - Make the Inbox module return an error immediatly when used
149
+ * - Make the Inbox module return an error immediately when used
150
150
* - Make the SDK reject any editor calls
151
- * - Make the SDK reject calls to batch.user .trackEvent(), batch.user.trackTransaction(), batch.user .trackLocation() and any related methods
151
+ * - Make the SDK reject calls to batch.profile .trackEvent(), batch.profile .trackLocation() and any related methods
152
152
*
153
- * Even if you opt in afterwards , data that has been generated while opted out WILL be lost.
153
+ * Even if you opt in afterward , data that has been generated while opted out WILL be lost.
154
154
*
155
155
* If you're also looking at deleting user data, please use batch.optOutAndWipeData()
156
156
*
@@ -282,8 +282,8 @@ export declare namespace BatchSDK {
282
282
identify ( identifier : string | null ) : void ;
283
283
284
284
/**
285
- * Get the user data editor. Don't forget to call save when you're done.
286
- * @return Batch user data editor
285
+ * Get the profile data editor. Don't forget to call save when you're done.
286
+ * @return Batch profile data editor
287
287
*/
288
288
getEditor ( ) : BatchProfileAttributeEditor ;
289
289
@@ -318,20 +318,20 @@ export declare namespace BatchSDK {
318
318
getInstallationID ( ) : Promise < undefined | string > ;
319
319
320
320
/**
321
- * Get the application language override set using BatchUserDataEditor . Batch must be started to read it.
321
+ * Get the application language override set using BatchProfileAttributeEditor . Batch must be started to read it.
322
322
* The promise will return the language you have previously set, if any, or undefined. Might be null/undefined if Batch isn't started.
323
323
* Might throw if Batch isn't started.
324
324
*/
325
325
getLanguage ( ) : Promise < undefined | string > ;
326
326
327
327
/**
328
- * Get the application region override set using BatchUserDataEditor . Batch must be started to read it.
328
+ * Get the application region override set using BatchProfileAttributeEditor . Batch must be started to read it.
329
329
* The promise will return the region you have previously set, if any, or undefined. Might be null/undefined if Batch isn't started.
330
330
*/
331
331
getRegion ( ) : Promise < undefined | string > ;
332
332
333
333
/**
334
- * Get the user identifier set using BatchUserDataEditor . Batch must be started to read it.
334
+ * Get the user identifier set using BatchProfileAttributeEditor . Batch must be started to read it.
335
335
* The promise will return the user identifier you have previously set, if any, or undefined. Might be null/undefined if Batch isn't started.
336
336
*/
337
337
getIdentifier ( ) : Promise < undefined | string > ;
@@ -417,8 +417,8 @@ export declare namespace BatchSDK {
417
417
setiOSNotificationTypes ( notifTypes : iOSNotificationTypes ) : void ;
418
418
419
419
/**
420
- * Set whether notifications should be show in the foreground on iOS.
421
- * If true, notifications will be shown like if the user was outside of your application and
420
+ * Set whether notifications should be shown in the foreground on iOS.
421
+ * If true, notifications will be shown like if the user was outside your application and
422
422
* `batchPushReceived` will only be triggered when the notification is tapped.
423
423
* @param showForegroundNotifications Show foreground notifications?
424
424
*/
@@ -658,7 +658,7 @@ export declare namespace BatchSDK {
658
658
}
659
659
660
660
/**
661
- * User data editor
661
+ * Profile attribute editor
662
662
*/
663
663
interface BatchProfileAttributeEditor {
664
664
/**
@@ -676,7 +676,7 @@ export declare namespace BatchSDK {
676
676
setRegion ( region : string | null ) : BatchProfileAttributeEditor ;
677
677
678
678
/**
679
- * Set the user email address.
679
+ * Set the profile email address.
680
680
*
681
681
* This requires to have a custom user ID registered
682
682
* or to call the `setIdentifier` method on the editor instance beforehand.
@@ -685,14 +685,33 @@ export declare namespace BatchSDK {
685
685
setEmailAddress ( email : string | null ) : BatchProfileAttributeEditor ;
686
686
687
687
/**
688
- * Set the user email marketing subscription state
688
+ * Set the profile email marketing subscription state
689
689
*
690
690
* @param state The state of the marketing email subscription. Must be "subscribed" or "unsubscribed".
691
691
*/
692
692
setEmailMarketingSubscription (
693
693
state : "subscribed" | "unsubscribed"
694
694
) : BatchProfileAttributeEditor ;
695
695
696
+ /**
697
+ * Set the profile phone number.
698
+ *
699
+ * This requires to have a custom profile ID registered or to call the `identify` method beforehand.
700
+ * @param phoneNumber A valid E.164 formatted string. Must start with a `+` and not be longer than 15 digits
701
+ * without special characters (eg: "+33123456789"). Null to reset.
702
+ */
703
+ setPhoneNumber ( phoneNumber : string | null ) : BatchProfileAttributeEditor ;
704
+
705
+ /**
706
+ * Set the profile SMS marketing subscription state.
707
+ *
708
+ * Note that profile's subscription status is automatically set to unsubscribed when users send a STOP message.
709
+ * @param state The state of the SMS marketing subscription. Must be "subscribed" or "unsubscribed".
710
+ */
711
+ setSMSMarketingSubscription (
712
+ state : "subscribed" | "unsubscribed"
713
+ ) : BatchProfileAttributeEditor ;
714
+
696
715
/**
697
716
* Set an attribute for a key
698
717
* @param key Attribute key. Cannot be null, empty or undefined. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
0 commit comments