KBMUser Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | KBMUser.h |
+ currentUser
The object representing the current user.
+ (nullable instancetype)currentUserDiscussion
Returns nil if +initWithSettings:completionHandler: has not been called yet.
See Also
Declared In
KBMUser.h
– addMetadata:
Adds custom metadata to the user. This info is used to provide more context around who a user is.
- (void)addMetadata:(NSDictionary *)metadataParameters
metadata |
The metadata to set for the current user. |
|---|
Discussion
Keys must be of type NSString, and values must be of type NSString, NSNumber, or NSDate; any other type will be converted to NSString using the -description method.
Example:
[user addMetadata:@{ @"nickname" : @"Lil' Big Daddy Slim", @"weight" : @650, @"premiumUser" : @YES }];
Changes to user metadata are uploaded in batches at regular intervals, when the app is sent to the background, or when a message is sent.
This API is additive, and subsequent calls will override values for the provided keys.
Declared In
KBMUser.h
userId
The assigned userId for this user.
@property (readonly, nullable) NSString *userIdDiscussion
Unlike externalId, this property is set automatically by BrandMessenger, and is not configurable. This is analogous to appUser._id in the REST API response. A user is assigned an userId once they start a conversation or when an existing user is logged in by calling +login:jwt:completionHandler:.
See Also
Declared In
KBMUser.h
externalId
The assigned externalId for this user.
@property (readonly, nullable) NSString *externalIdDiscussion
This property is set by calling +login:jwt:completionHandler:.
Unlike userId, this value is assigned and managed by the developer, and is used to identify a user across devices and app installations.
See Also
Declared In
KBMUser.h
firstName
The user’s first name, to be used as part of the display name when sending messages.
@property (copy, nullable) NSString *firstNameDeclared In
KBMUser.h
metadata
The user’s custom metadata.
@property (copy, readonly) NSDictionary *metadataDeclared In
KBMUser.h
lastName
The user’s last name, to be used as part of the display name when sending messages.
@property (copy, nullable) NSString *lastNameDeclared In
KBMUser.h
email
The user’s email, to be used to display a gravatar.
@property (copy, nullable) NSString *emailDeclared In
KBMUser.h
signedUpAt
The date the user started using your service.
@property (copy, nullable) NSDate *signedUpAtDeclared In
KBMUser.h