Beispiel #1
0
        /// <summary>
        /// Give kudos for the specified activity.
        /// </summary>
        /// <param name="activityId">The activity you want to give kudos for.</param>
        public async Task GiveKudosAsync(string activityId)
        {
            try
            {
                var accessToken = await _settingsService.GetStoredStravaAccessTokenAsync();

                string postUrl = $"{Endpoints.Activity}/{activityId}/kudos?access_token={accessToken}";
                await _stravaWebClient.SendPostAsync(new Uri(postUrl));
            }
            catch (Exception ex)
            {
                string title = $"StravaActivityService.GiveKudosAsync - activityId {activityId}";
                _logService.LogException(title, ex);
            }
        }
        /// <summary>
        /// Give kudos for the specified activity.
        /// </summary>
        /// <param name="activityId">The activity you want to give kudos for.</param>
        public async Task GiveKudosAsync(string activityId)
        {
            try
            {
                var accessToken = await _settingsService.GetStoredStravaAccessTokenAsync();

                string postUrl = $"{Endpoints.Activity}/{activityId}/kudos?access_token={accessToken}";
                await _stravaWebClient.SendPostAsync(new Uri(postUrl));
            }
            catch (Exception ex)
            {
#if !DEBUG
                _errorMessage.Clear();
                _errorMessage.AppendLine($"StravaActivityService.GiveKudosAsync - activityId {activityId}");
                _errorMessage.AppendLine(ex.Message);
                ServiceLocator.Current.GetInstance <IGoogleAnalyticsService>().Tracker.SendException(_errorMessage.ToString(), false);
#endif
            }
        }
        /// <summary>
        /// Give kudos for the specified activity.
        /// </summary>
        /// <param name="activityId">The activity you want to give kudos for.</param>
        public async Task GiveKudosAsync(string activityId)
        {
            try
            {
                var accessToken = await _settingsService.GetStoredStravaAccessTokenAsync();

                string postUrl = $"{Endpoints.Activity}/{activityId}/kudos?access_token={accessToken}";
                await _stravaWebClient.SendPostAsync(new Uri(postUrl));
            }
            catch (Exception)
            {
                //TODO: Glenn - Use logger to log errors ( Google )
            }
        }