Beispiel #1
0
        static RequestLoader()
        {
            var endPoint = ConfigurationManager.AppSettings["football_api_url"];
            var host     = ConfigurationManager.AppSettings["football_api_host"];
            var key      = ConfigurationManager.AppSettings["football_api_key"];

            FootballAPI = new FootballAPI();
            FootballAPI.Init(endPoint, host, key);
        }
Beispiel #2
0
        private void Update()
        {
            if (Time.realtimeSinceStartup - _lastLocationUpdate < UpdateInterval &&
                _locationService.status != LocationServiceStatus.Running)
            {
                return;
            }

            _lastLocationUpdate = Time.realtimeSinceStartup;
            FootballAPI.SetUserLocation(_locationService.lastData.latitude, _locationService.lastData.longitude, null);
        }
Beispiel #3
0
        private void OnAuthenticated(bool isSuccess, string token)
        {
            IsAuthenticated = isSuccess;

            if (isSuccess)
            {
                FootballAPI.BearerToken = token;
                Debug.Log($"Auth Successful: {token}");

                FootballAPI.GetCurrentUser(OnUserDataUpdated);
            }
            else
            {
                Debug.LogError("Auth failed!");
            }
        }
 private void FetchCards()
 {
     FootballAPI.GetCards(OnCardsFetched);
 }
Beispiel #5
0
 private static void ReloadUser(bool isSuccess, User user)
 {
     FootballAPI.GetCurrentUser(OnUserDataUpdated);
 }
Beispiel #6
0
 public static void UpdateUserName(string newUsername)
 {
     FootballAPI.SetUsername(newUsername, ReloadUser);
 }
Beispiel #7
0
 public static void UpdateUserClub(string clubId)
 {
     FootballAPI.SetUserClub(clubId, ReloadUser);
 }
Beispiel #8
0
 public void Authenticate()
 {
     FootballAPI.AquireToken("123UDID", OnAuthenticated);
 }
Beispiel #9
0
 private void FetchClubs()
 {
     FootballAPI.GetClubs(OnClubsFetched);
 }
Beispiel #10
0
 private void LoadUserClub(string clubId)
 {
     FootballAPI.GetClub(clubId, OnUserClubUpdated);
 }
Beispiel #11
0
 private void LoadUser(string userId)
 {
     FootballAPI.GetUser(userId, OnUserProfileUpdated);
 }