Create Account

Create a Versus Account.

Android

/**
* @property birthDate The Users Birthdate (Must be 18 or older)
* @property email The E-Mail Address associated with the users Versus account
* @property password The password associated with the users Versus Account
* @property agreementId Versus Agreement id.  Can be obtained from Versus Agreement Services
* @see VersusAgreementServices
* @see Account
* @return Account
*
*/
fun create(birthDate: Date, email: String, password: String, agreementId: String): VsLiveData<Account>
val birthday: Date = SignUpRunner.everyonesBirthday
val email: String = "[email protected]"
val password: String = "password"
val VersusAgreementId: Agreement.NeededResponse = allAgreements?.VersusAgreement?.id ?: throw Exception()

SDK.Account.create(birthday, email, password, VersusAgreementId)
     .observe(object : VsObserver<Account>() {
    override fun onError(error: Throwable) {}

    override fun onChanged(t: Account) {}
   }
})

iOS

/// - Parameters:
///     - email: The game Id associated with your game.
///     - password: This should be a unique id associated with a players' device.
///     - birthday: Birthday (Format: "MM/DD/YYYY")
///     - agreementId: Latest Agreement Id for which the user has agreed. (See: getLatestAgreements)
///     - completionHandler: Closure which returns a Versus account (or VersusError)
createAccount(email: String, password: String, birthdate: Date, agreementId: String,
                  completionHandler: @escaping VersusApiResponse<Account>)
VersusSDK?.createAccount(email: email, password: password, birthdate: birthdate, agreementId: VersusAgreementId,
                                 completionHandler: { (account, error) in
    if error != nil {
        // error occurred
    } else {
        // Successfully signed in — the `session` returned corresponds to user’s active Versus session.
    }
})