本文介绍了TweetSharp GetAccessToken方法返回null,但只是有时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接收与OauthVerifier和RequestToken回调从Twitter我的应用程序使用Tweetsharp以获得访问令牌后:

After receiving a callback with OauthVerifier and RequestToken from Twitter my app uses Tweetsharp to get the access token:

OAuthAccessToken accessToken = service.GetAccessToken(user.TwitterRequestToken.InnerRequestToken, oauth_verifier);

这工作正常,对于大多数用户,但有时这种方法,无需拨打电话到Twitter返回null。

This works fine for most users but sometimes this method returns null without making a call to Twitter.

推荐答案

此问题是由更改导致怎样的Twitter用户ID存储的,由32位整数移动到64位。这发生在10月21日2013年

This problem is caused by a change to how Twitter stores UserID's, moving from 32bit integers to 64bit. This occurred on October 21st 2013. https://dev.twitter.com/blog/64-bit-twitter-user-idpocalypse

Tweetsharp最后一次在此日期之前更新,因此还是把用户ID int和不长的值。似乎有人已经解决了该问题,但更改尚未传递到的NuGet作为创作者不再更新包。

Tweetsharp was last updated before this date and therefore still treats user id's as int and not long values. It seems someone has fixed the issue https://github.com/danielcrenna/tweetsharp/issues/139 but the change hasn't been passed to NUGET as the creator is no longer updating the package.

谁更改之前注册的用户不会有任何麻烦,但其他谁后,注册用户将遇到提到的错误。

Users who registered before the changes will have no trouble but other users who registered after will encounter the mentioned error.

我们希望,它最终会被更新,但在此期间,最好的行动当然是使用的其中包括修改。

Hopefully, it will eventually be updated but in the meantime the best course of action is to use an unoffical TweetSharp package which includes the changes.

请注意:这个非官方的包似乎引进了很多其他问题也可能找到解决这个法子

Please Note: This unofficial package seems to introduce a lot of other problems too, may have to find another way around this.

这篇关于TweetSharp GetAccessToken方法返回null,但只是有时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-20 01:47