TMBUserParams
@interface TMBUserParams : NSObject <TMBObjectEncodable>
An object representing parameters used to make user commands. Not all parameters are needed for all requests. - see: https://tamber.com/docs/api/#user
-
Initialize empty user. TMBClient uses default user id when making relevant requests.
Declaration
Objective-C
+ (nullable instancetype)defaultUser;
Swift
class func defaultUser() -> Self?
-
Initialize user with id.
Declaration
Objective-C
+ (nullable instancetype)userWithId:(nonnull NSString *)userId;
Swift
class func user(withId userId: String) -> Self?
-
Initialize user with metadata (TMBClient uses default user id when making relevant requests).
Declaration
Objective-C
+ (nullable instancetype)userWithMetadata:(nullable NSDictionary *)metadata;
Swift
class func user(withMetadata metadata: [AnyHashable : Any]?) -> Self?
-
Initialize user with metadata and events (array of TMBEventParams - user field should be empty or set to id of the given user). TMBClient uses default user id when making relevant requests.
Declaration
Objective-C
+ (nullable instancetype)userWithMetadata:(nullable NSDictionary *)metadata events:(nullable NSArray *)events;
Swift
class func user(withMetadata metadata: [AnyHashable : Any]?, events: [Any]?) -> Self?
-
Initialize user with id and metadata (TMBClient uses default user id when making relevant requests).
Declaration
Objective-C
+ (nullable instancetype)userWithId:(nonnull NSString *)userId metadata:(nullable NSDictionary *)metadata;
Swift
class func user(withId userId: String, metadata: [AnyHashable : Any]?) -> Self?
-
Initialize user with id, metadata, and events (TMBClient uses default user id when making relevant requests).
Declaration
Objective-C
+ (nullable instancetype)userWithId:(nonnull NSString *)userId metadata:(nullable NSDictionary *)metadata events:(nullable NSArray *)events;
Swift
class func user(withId userId: String, metadata: [AnyHashable : Any]?, events: [Any]?) -> Self?
-
Adds additional api parameter for the mode when saving a user (“merge” or “replace”).
Declaration
Objective-C
- (void)setSaveMode:(nullable NSString *)mode;
Swift
func setSaveMode(_ mode: String?)
-
Unique ID associated with the user.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *ID;
Swift
var id: String? { get set }
-
List of all of the events (TMBEventParams) that are associated with the user (i.e. all passed user-item interactions).
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSArray *events;
Swift
var events: [Any]? { get set }
-
Data associated with the user.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSDictionary *metadata;
Swift
var metadata: [AnyHashable : Any]? { get set }
-
If you would like to return new recommendations for the user, set getRecs (accepts number, page, and filter params). Note that all fields are optional, and an initialized, non-NULL TMBDiscoverParams instance (even if no properties/fields are set) will return recommendations.
Declaration
Objective-C
@property (nonatomic, copy, nullable) TMBDiscoverParams *getRecs;
Swift
@NSCopying var getRecs: TMBDiscoverParams? { get set }