User

@interface User : NSObject <NSCoding, NSCopying>

User model for the VouchrSDK. Users are used to identify the logged in user and typically gifts are sent to a User(s).

  • The user id of the User.

    Declaration

    Objective-C

    @property (readonly, nonatomic) long long userId;

    Swift

    var userId: Int64 { get }
  • The email address of the User.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSString *_Nonnull email;

    Swift

    var email: String { get }
  • The first name of the User.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *firstName;

    Swift

    var firstName: String? { get }
  • The last name of the User.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *lastName;

    Swift

    var lastName: String? { get }
  • The business name of the User. If a User is a ‘brand’ they will typically have a business name.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *businessName;

    Swift

    var businessName: String? { get }
  • The full name of the User. Usually `firstName` `lastName`.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *fullName;

    Swift

    var fullName: String? { get }
  • A short name of the User. Usually `firstName` `L.`.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *shortName;

    Swift

    var shortName: String? { get }
  • The cover photo for a User.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *coverImageUrl;

    Swift

    var coverImageUrl: String? { get }
  • A profile picture for a User.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *profileImageUrl;

    Swift

    var profileImageUrl: String? { get }
  • A list of UserNetworks for a User. If a user authenticates with different platforms using the same id or email address, or they add a secondary email, they will show up here.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<UserNetwork *> *_Nonnull userNetworks;

    Swift

    var userNetworks: [UserNetwork] { get }
  • Default initializer for a User.

    Declaration

    Objective-C

    + (nonnull instancetype)userWithDictionary:(nonnull NSDictionary *)dictionary;

    Swift

    convenience init(dictionary: [AnyHashable : Any])

    Parameters

    dictionary

    - A dictionary representation of a User that will be parsed. Typically this is returned from the Vouchr Server.

    Return Value

    an Instance of User.

  • Converts a User to an NSDictionary that can be used for caching or sending to the server.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)dictionaryRepresentation;

    Swift

    func dictionaryRepresentation() -> [AnyHashable : Any]

    Return Value

    dictionary - Dictionary form of a User.