SKYSignupUserOperation

@interface SKYSignupUserOperation : SKYAuthOperation

is a subclass of which an user object in Skygear. Use this operation to create a new user account in the container. When a new user is created, an and an will be returned.

A user account is uniquely identified by an email address given by the user. If the user does not provide an email address, you can create an anonymous user instead and change the user information to associate an email address to this user later.

A password must be supplied to create an user account in order to protect user content. For anonymous user account, you should generate a password on the user’s behalf and save the password.

If you assign a block to signupCompletionBlock, it will be called when the operation is completed.

  • Auth data of the user. The Auth data is a unique dictionary across the system. The structure of auth data is defined by the server. Default keys are username and email.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSDictionary *_Nullable authData;

    Swift

    var authData: [AnyHashable : Any]? { get set }
  • Password given by the user or generated by the application on behalf of the user.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nullable password;

    Swift

    var password: String? { get set }
  • Profile is the data of user record

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSDictionary *_Nullable profile;

    Swift

    var profile: [AnyHashable : Any]? { get set }
  • Whether the operation is creating an anonymous user account.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL anonymousUser;

    Swift

    var anonymousUser: Bool { get set }
  • The block to execute when the operation completes.

    • recordID: An object containing the user record identifier.
    • accessToken: An object for performing other operations on behalf of this user.
    • error: If an error occurred, this object describes the error.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) void (^_Nullable)
        (SKYRecord *_Nullable, SKYAccessToken *_Nullable, NSError *_Nullable)
            signupCompletionBlock;

    Swift

    var signupCompletionBlock: ((SKYRecord?, SKYAccessToken?, Error?) -> Void)? { get set }
  • Initializes and returns and operation configured to create a user account with the specified auth data, password and profile.

    Declaration

    Objective-C

    + (nonnull instancetype)operationWithAuthData:(nonnull NSDictionary *)authData
                                         password:(nonnull NSString *)password
                                          profile:(NSDictionary *_Nullable)profile;

    Swift

    convenience init(authData: [AnyHashable : Any], password: String, profile: [AnyHashable : Any]?)

    Parameters

    authData

    A dictionary of identifier provided by the user.

    password

    A password provided by the user.

    profile

    A dictionary of data stored in user record.

    Return Value

    object.

  • Initializes and returns and operation configured to create a user account with the specified auth data and password.

    Declaration

    Objective-C

    + (nonnull instancetype)operationWithAuthData:(nonnull NSDictionary *)authData
                                         password:(nonnull NSString *)password;

    Swift

    convenience init(authData: [AnyHashable : Any], password: String)

    Parameters

    authData

    A dictionary of identifier provided by the user.

    password

    A password provided by the user.

    Return Value

    object.

  • Initializes and returns and operation configured to create an anonymous user account.

    Declaration

    Objective-C

    + (nonnull instancetype)operationWithAnonymousUser;

    Swift

    class func withAnonymousUser() -> Self

    Return Value

    object.