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); }
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); }
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); }
private static void ReloadUser(bool isSuccess, User user) { FootballAPI.GetCurrentUser(OnUserDataUpdated); }
public static void UpdateUserName(string newUsername) { FootballAPI.SetUsername(newUsername, ReloadUser); }
public static void UpdateUserClub(string clubId) { FootballAPI.SetUserClub(clubId, ReloadUser); }
public void Authenticate() { FootballAPI.AquireToken("123UDID", OnAuthenticated); }
private void FetchClubs() { FootballAPI.GetClubs(OnClubsFetched); }
private void LoadUserClub(string clubId) { FootballAPI.GetClub(clubId, OnUserClubUpdated); }
private void LoadUser(string userId) { FootballAPI.GetUser(userId, OnUserProfileUpdated); }