TweetSharp GetAccessToken method returns null but only sometimes

眉间皱痕 提交于 2019-12-24 03:46:09

问题


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);

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


回答1:


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 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.



来源:https://stackoverflow.com/questions/21138289/tweetsharp-getaccesstoken-method-returns-null-but-only-sometimes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!