-
Notifications
You must be signed in to change notification settings - Fork 13
Verification Code
Riot introduced Verification Code (also know as Third Party Code). It is a authentication system that confirms the identity of a summoner. Players have the possibility to enter a code in the client settings. Then using Riot API an application can receive this code and validate that the player owns the account.
- ThirdPartyVerificationCode(by: SummonerId, on: Region)
- SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
- Region: The region where the summoner plays.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (String?, String?)
. String contains the verification code if it exists and will be nil only if summoner was not found on this Region or he did not enter a valid verification code. Valid verification code can only contain letters (lower and upper case), numbers and '-', with 256 characters maximum. The String parameter contains the first error description encountered if existing.
league.lolAPI.getThirdPartyVerificationCode(by: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (verificationCode, errorMsg) in
if let verificationCode = verificationCode {
print("Success!")
}
else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}