예제 #1
0
        private async void GetLeaderBoardsListAsync()
        {
            var trophyRequest = new TrophyRequest();

            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                PROBA.LeaderBoardsListCanceled(RequestResponse.NoInternet);
                return;
            }
            try
            {
                var(success, statusCode, leaderBoards) = await _probaHttpClient.GetLeaderBoardsListAsync(trophyRequest);

                if (!success)
                {
                    PROBA.LeaderBoardsListCanceled(RequestResponse.Error);
                    return;
                }

                PROBA.LeaderBoardsListReceived(leaderBoards);
            }
            catch (Exception e)
            {
                PROBA.LeaderBoardsListCanceled(RequestResponse.Error);
                _probaLogger.LogError(e.Message, e.StackTrace);
            }
        }