Classes
The following classes are available globally.
-
Source that’s only set when an action was manually triggered by +[BatchActions performActionIdentifiedBy:withArguments:]
Declaration
Objective-C
@interface BatchManualUserActionSource <BatchUserActionSource>
-
Represents an action that can be triggered by the user from anywhere.
See moreDeclaration
Objective-C
@interface BatchUserAction
-
Batch’s Actions module
See moreDeclaration
Objective-C
@interface BatchActions
-
Batch’s main entry point.
See moreDeclaration
Objective-C
@interface Batch
-
Object holding data to be associated to an event
Keys should be made of letters, numbers or underscores ([a-z0-9_]) and can’t be longer than 30 characters.
See moreDeclaration
Objective-C
@interface BatchEventData
-
Batch’s Event Dispatcher module.
See moreDeclaration
Objective-C
@interface BatchEventDispatcher
-
Undocumented
See moreDeclaration
Objective-C
@interface BatchInboxNotificationContentMessage : NSObject /** Notification title (if present) */ @property (nonatomic, readonly, nullable) NSString *title; /** Notification subtitle (if present) */ @property (nonatomic, readonly, nullable) NSString *subtitle; /** Notification alert body */ @property (nonatomic, readonly, nullable) NSString *body; @end
-
BatchInboxNotificationContent is the model for notifications fetched using the Inbox API Use it to display them in the way you like.
See moreDeclaration
Objective-C
@interface BatchInboxNotificationContent
-
BatchInboxFetcher allows you to fetch notifications that have been sent to a user (or installation, more on that later) in their raw form, allowing you to display them in a list, for example. This is also useful to display messages to users that disabled notifications.
Once you get your BatchInboxFetcher instance, you should call fetchNewNotifications: to fetch the initial page of messages: nothing is done automatically. This method is also useful to refresh the list.
In an effort to minimize network and memory usage, messages are fetched by page (batches of messages): this allows you to easily create an infinite list, loading more messages on demand. While you can configure the maximum number of messages you want in a page, the actual number of returned messages can differ, as the SDK may filter some of the messages returned by the server (such as duplicate notifications, etc…).
As BatchInboxFetcher caches answers from the server, instances of this class should be tied to the lifecycle of the UI consuming it. For example, you should keep a reference to this object during your UIViewController’s entire life. Another reason to keep the object around, is that you cannot mark a message as read with another BatchInbox instance that the one that gave you the message in the first place.
A BatchInboxFetcher instance will hold to all fetched messages: be careful of how long you’re keeping the instances around. You can also set a upper messages limit, after which BatchInbox will stop fetching new messages, even if you call fetchNextPage.
See moreDeclaration
Objective-C
@interface BatchInboxFetcher
-
Batch’s inbox module. Use this to get a configured instance of the inbox client.
See moreDeclaration
Objective-C
@interface BatchInbox
-
Batch’s messaging module
See moreDeclaration
Objective-C
@interface BatchMessaging
-
Model describing an alert message’s CTA
See moreDeclaration
Objective-C
@interface BatchAlertMessageCTA
-
Model describing the content of an alert message
See moreDeclaration
Objective-C
@interface BatchAlertMessageContent <BatchInAppMessageContent>
-
Model describing an interstitial message’s CTA
See moreDeclaration
Objective-C
@interface BatchInterstitialMessageCTA
-
Model describing the content of an interstitial message
See moreDeclaration
Objective-C
@interface BatchInterstitialMessageContent <BatchInAppMessageContent>
-
Undocumented
See moreDeclaration
Objective-C
@interface BatchMessageCTA: BatchMessageAction @property (readonly, nullable) NSString *label; @end
-
Model describing a banner message’s global tap action
Declaration
Objective-C
@interface BatchBannerMessageAction : BatchMessageAction
-
Model describing an image message’s global tap action
Declaration
Objective-C
@interface BatchImageMessageAction : BatchMessageAction
-
Model describing a banner message’s CTA
See moreDeclaration
Objective-C
@interface BatchBannerMessageCTA
-
Model describing the content of a banner message
See moreDeclaration
Objective-C
@interface BatchBannerMessageContent <BatchInAppMessageContent>
-
Model describing the content of an image message
See moreDeclaration
Objective-C
@interface BatchMessageImageContent <BatchInAppMessageContent>
-
Model describing the content of a modal message
See moreDeclaration
Objective-C
@interface BatchMessageModalContent <BatchInAppMessageContent>
-
Model describing the content of a webview message
See moreDeclaration
Objective-C
@interface BatchMessageWebViewContent <BatchInAppMessageContent>
-
Represents a Batch Messaging message
Declaration
Objective-C
@interface BatchMessage
-
Represents a Batch Messaging message coming from an In-App Campaign
See moreDeclaration
Objective-C
@interface BatchInAppMessage : BatchMessage
-
Represents a Batch Messaging message coming from a push
Declaration
Objective-C
@interface BatchPushMessage : BatchMessage
-
Provides Batch-related Push methods Actions you can perform in BatchPush.
See moreDeclaration
Objective-C
@interface BatchPush
-
Implementation of UNUserNotificationCenterDelegate that
Foreground notifications will not be displayed with the default settings. Use the property
showForegroundNotifications
to control this.This class should not be subclassed. If you want to do so, please implement UNUserNotificationCenterDelegate directly
See moreDeclaration
Objective-C
@interface BatchUNUserNotificationCenterDelegate
-
Batch’s User Module
See moreDeclaration
Objective-C
@interface BatchUser
-
Undocumented
See moreDeclaration
Objective-C
@interface BatchUserDataEditor : NSObject /** Override the detected user language. @param language Language override: lowercase, ISO 639 formatted string. nil to reset. */ - (void)setLanguage:(nullable NSString*)language; /** Override the detected user region. @param region Region override: uppercase, ISO 3166 formatted string. nil to reset. */ - (void)setRegion:(nullable NSString*)region; /** Set the user identifier. @warning Be careful: you should make sure the identifier uniquely identifies a user. When pushing an identifier, all installations with that identifier will get the Push, which can cause some privacy issues if done wrong. @param identifier User identifier. */ - (void)setIdentifier:(nullable NSString*)identifier; /** Set a custom user attribute for a key. The attribute can be one of the following types, or their native Swift equivalent - NSString Must not be longer than 64 characters. Can be empty. For better results, you should make them upper/lowercase and trim the whitespaces. - NSNumber Anything bigger than a `long long` or a `double` will be rejected. Unsigned values will be rejected. Booleans are supported, but should be initialized with `[NSNumber numberWithBool:<your value>]` or `@YES/@NO`. - NSDate Note that since timezones are not supported, this will typically represent UTC dates. Using any unsupported type as a value (NSNull, NSObject, NSArray, NSDictionary for example) will **NOT** work. - NSURL Must not be longer than 2048 characters. Can't be empty. Must follow the format 'scheme://[authority][path][?query][#fragment]'. @param attribute The attribute value. If nil, the attribute will be removed. See method description for more info about what's allowed. @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. */ - (void)setAttribute:(nullable NSObject*)attribute forKey:(nonnull NSString*)key; /// Set a boolean custom user attribute for a key. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setBooleanAttribute:(BOOL)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set a date custom user attribute for a key. /// Note that since timezones are not supported, this will typically represent UTC dates. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setDateAttribute:(nonnull NSDate*)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set a string custom user attribute for a key. /// Must not be longer than 64 characters. Can be empty. /// For better results, you should make them upper/lowercase and trim the whitespaces. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setStringAttribute:(nonnull NSString*)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set a boolean custom user attribute for a key. /// Anything bigger than a `long long` or a `double` will be rejected. /// Unsigned values will be rejected. /// Booleans are supported, but should be initialized with `[NSNumber numberWithBool:<your value>]` or `@YES/@NO`. /// Note: `setBoolean/Integer/LongLong/Float/Double` should be preferred over this method, especially for booleans. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setNumberAttribute:(nonnull NSNumber*)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set an NSInteger/Int custom user attribute for a key. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setIntegerAttribute:(NSInteger)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set an long long/Int64 custom user attribute for a key. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setLongLongAttribute:(long long)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set an float custom user attribute for a key. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setFloatAttribute:(float)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set an double custom user attribute for a key. /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setDoubleAttribute:(double)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /// Set an url custom user attribute for a key. /// Must not be longer than 2048 characters. Can't be empty or nil. /// Must follow the format 'scheme://[authority][path][?query][#fragment]' /// @param attribute The attribute value. /// @param key The attribute key. Can't be nil. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. /// @param error Pointer to an error describing. Note that the error is only about key/value validation, and doesn't mean the value has been sent to the server yet. /// @returns A boolean indicating whether the attribute passed validation or not. - (BOOL)setURLAttribute:(nonnull NSURL*)attribute forKey:(nonnull NSString*)key error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(set(attribute:forKey:)); /** Removes an attribute for the specified key. @param key The attribute key. Can't be nil. */ - (void)removeAttributeForKey:(nonnull NSString*)key; /** Removes all custom attributes. @warning Once saved, this action cannot be undone. */ - (void)clearAttributes; /** Add a tag to the specified collection. If empty, the collection will be created automatically. @param tag The tag to add. Cannot be nil or empty. Must be a string no longer than 64 characters. @param collection The tag collection name. Cannot be nil. Must be a string of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. */ - (void)addTag:(nonnull NSString*)tag inCollection:(nonnull NSString*)collection; /** Removes a tag from the specified collection. @param tag The tag to remove. Cannot be nil. If the tag doesn't exist, this method will do nothing. @param collection The tag collection name. Cannot be nil. Must be a string of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. If the collection doesn't exist, this method will do nothing, but apply won't fail. */ - (void)removeTag:(nonnull NSString*)tag fromCollection:(nonnull NSString*)collection; /** Removes all tags. @warning Once saved, this action cannot be undone. */ - (void)clearTags; /** Removes all tags from a collection. @warning Once applied, this action cannot be undone. @param collection The tag collection name. Cannot be nil. Must be a string of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters. */ - (void)clearTagCollection:(nonnull NSString*)collection; /** Save all of the pending changes made in that editor. @warning This action cannot be undone. */ - (void)save; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface BatchUserAttribute: NSObject /** The value of the attribute. You can use the typed methods below to get a typed result. */ @property (nonatomic, nonnull) id value; /** The type of the value for the attribute. */ @property (assign, nonatomic) BatchUserAttributeType type; /** Get the date value for date type attributes. @return A date value or nil if the attribute is not a date. */ - (nullable NSDate *)dateValue; /** Get the string value for string type attributes. @return A string value or nil if the attribute is not a string. */ - (nullable NSString *)stringValue; /** Get the number value for double, long long and bool type attributes. @return A string value or nil if the attribute is not a number. */ - (nullable NSNumber *)numberValue; /** Get the url value for url type attributes. @return An url value or nil if the attribute is not an url. */ - (nullable NSURL *)urlValue; @end
-
Describe a complete user profile. Use this object to access all user info.
See moreDeclaration
Objective-C
@interface BatchUserProfile