You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a .NET MAUI Blazor Hybrid (.NET 7) mobile app and using TweetinviAPI 5.0.4. When I test my app locally on my iPhone iOS (16.0.3) it is not working and get the following stack trace error:
[0:] TwitterService.GetTimelineAsync - Error - Operation is not supported on this platform. at System.Net.Http.NSUrlSessionHandler.set_Proxy(IWebProxy value)
at System.Net.Http.HttpClientHandler.InvokeNativeHandlerMethod(String name, Object[] parameters)
at System.Net.Http.HttpClientHandler.SetProxy(IWebProxy value)
at System.Net.Http.HttpClientHandler.set_Proxy(IWebProxy value)
at Tweetinvi.WebLogic.TwitterClientHandler.set_TwitterQuery(ITwitterQuery value)
at Tweetinvi.WebLogic.HttpClientWebHelper.GetHttpClient(ITwitterQuery twitterQuery, ITwitterClientHandler twitterHandler)
at Tweetinvi.WebLogic.HttpClientWebHelper.GetHttpResponseAsync(ITwitterQuery twitterQuery, ITwitterClientHandler handler)
at Tweetinvi.WebLogic.WebRequestExecutor.<>c__DisplayClass4_0.<<ExecuteQueryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Tweetinvi.WebLogic.WebRequestExecutor.<ExecuteTwitterQuerySafelyAsync>d__7`1[[Tweetinvi.Core.Web.ITwitterResponse, Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at Tweetinvi.WebLogic.TwitterRequestHandler.ExecuteQueryAsync(ITwitterRequest request)
at Tweetinvi.Credentials.TwitterAccessor.<ExecuteRequestAsync>d__4`1[[Tweetinvi.Models.DTO.ITweetDTO[], Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at Tweetinvi.Core.Iterators.TwitterPageIterator`2.<NextPageAsync>d__12[[Tweetinvi.Core.Web.ITwitterResult`1[[Tweetinvi.Models.DTO.ITweetDTO[], Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null]], Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null],[System.Nullable`1[[System.Int64, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Tweetinvi.Core.Iterators.TwitterIteratorProxy`3.<NextPageAsync>d__12[[Tweetinvi.Core.Web.ITwitterResult`1[[Tweetinvi.Models.DTO.ITweetDTO[], Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null]], Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null],[Tweetinvi.Models.ITweet, Tweetinvi.Core, Version=5.0.4.0, Culture=neutral, PublicKeyToken=null],[System.Nullable`1[[System.Int64, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Tweetinvi.Client.TimelinesClient.GetUserTimelineAsync(IGetUserTimelineParameters parameters)
My Service code example that is called when error occurs:
using System.Diagnostics;
using Tweetinvi;
using Tweetinvi.Models;
namespace FooMobileApp.Services;
public class TwitterService
{
private readonly string TWITTER_API_KEY = "######";
private readonly string TWITTER_API_SECRET = "######";
private readonly string TWITTER_API_TOKEN = "######";
private readonly string TIMELINE_USER = "foo"; // note this is made up for code example
TwitterClient twitterClient;
public TwitterService()
{
this.twitterClient = new TwitterClient(TWITTER_API_KEY, TWITTER_API_SECRET, TWITTER_API_TOKEN);
}
public async Task<ITweet[]> GetTimelineAsync(int numTweets = 25)
{
ITweet[] tweets = null;
try
{
tweets = await twitterClient.Timelines.GetUserTimelineAsync(TIMELINE_USER);
if (tweets != null && tweets.Length > 0)
{
tweets = tweets.Take(numTweets).ToArray();
}
}
catch (Exception ex)
{
Debug.WriteLine("TwitterService.GetTimelineAsync - Error - " + ex.Message + ex.StackTrace);
}
return tweets;
}
}
Any suggestions?
The text was updated successfully, but these errors were encountered:
I am working on a .NET MAUI Blazor Hybrid (.NET 7) mobile app and using TweetinviAPI 5.0.4. When I test my app locally on my iPhone iOS (16.0.3) it is not working and get the following stack trace error:
My Service code example that is called when error occurs:
Any suggestions?
The text was updated successfully, but these errors were encountered: