-
Notifications
You must be signed in to change notification settings - Fork 13
Riot Accounts
Riot Accounts are common data throughout all games about a player. It contains the SummonerPuuid and RiotId.
- Account(byPuuid: SummonerPuuid, on: WorldRegion)
- Account(byRiotId: RiotId, on: WorldRegion)
- AccountActiveShards(puuid: SummonerPuuid, game: ShardGame, on: WorldRegion)
Account (by SummonerPuuid)
- SummonerPuuid: Represents the unique identifier of a summoner.
- WorldRegion: The global region where RiotAccount exists.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (RiotAccount?, String?)
. RiotAccount contains the SummonerPuuid and RiotId of the player found. Result will be nil only if player with SummonerPuuid was not found on this WorldRegion. The String parameter contains the first error description encountered if existing.
league.riotAPI.getAccount(byPuuid: SummonerPuuid("Mopk9O_5xL3InZzRnXOMW0ay0FDpTcfKwjeWMLDLvVZhNa17JsrjXJt8jRfxq23R_Ct5RHLLh4-6dA"), on: .Europe) { (riotAccount, errorMsg) in
if let riotAccount = riotAccount {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
Account(by RiotId)
- RiotId: A Player global identifier. It is composed of the name appearing in game as well as a tag
- WorldRegion: The global region where RiotAccount exists.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (RiotAccount?, String?)
. RiotAccount contains the SummonerPuuid and RiotId of the player found. Result will be nil only if player with RiotId was not found on this WorldRegion. The String parameter contains the first error description encountered if existing.
league.riotAPI.getAccount(byRiotId: RiotId(gameName: "Sc0ra", tagLine: "EUW"), on: .Europe) { (riotAccount, errorMsg) in
if let riotAccount = riotAccount {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}
- SummonerPuuid: Represents the unique identifier of a summoner.
- ShardGame: a Riot's game compatible with shard api
- WorldRegion: The global region where RiotAccount exists.
Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (RiotAccountActiveShard?, String?)
. RiotAccountActiveShard contains the shard value. Result will be nil only if player with SummonerPuuid was not found on this WorldRegion, in the specified game. The String parameter contains the first error description encountered if existing.
guard let shardGame = ShardGame(.LEGENDS_OF_RUNNETERRA) else { return }
league.riotAPI.getAccountActiveShards(puuid: SummonerPuuid("Mopk9O_5xL3InZzRnXOMW0ay0FDpTcfKwjeWMLDLvVZhNa17JsrjXJt8jRfxq23R_Ct5RHLLh4-6dA"), game: shardGame, on: .Europe) { (riotActiveShard, errorMsg) in
if let riotActiveShard = riotActiveShard {
print("Success!")
} else {
print("Request failed cause: \(errorMsg ?? "No error description")")
}
}