ios - 使用 token 创建的 Twitter 帐户在 iOS7 上失败

标签 ios twitter ios7 acaccount

我正在开发一款在 iOS6/7 上运行的应用程序,其中包含要在 Twitter 上发布的自定义 View 。为了改善用户体验,如果没有可用的系统帐户,我会向用户提供一个 webview 以输入他们的凭据,按照 ACAccountCredential.h 中的建议将它们存储在 ACAccountStore 中并使用它来发布。

它在 iOS6 上运行良好,但在 iOS7 上共享失败并出现 401 错误。奇怪的是,帐户保存在 ACAccountStore 中没有错误,Twitter 应用程序可以使用它在 Twitter 上阅读和发布(无需进一步登录),所以我假设帐户( token 和 token secret )工作正常.

SLRequest *postRequest = nil;
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"];
NSDictionary *content = @{@"status":self.textToShare};
postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodPOST
URL:url
parameters:content];

[postRequest setAccount:self.twitterAccount];
[postRequest performRequestWithHandler:completionHandler];

我也尝试过使用 API v1.1,但它似乎没有帮助。有什么想法吗?

最佳答案

通过将 URL 更改为使用 HTTPS 并使用 API v1.1,它可以在 iOS6 和 iOS7 上运行。

关于ios - 使用 token 创建的 Twitter 帐户在 iOS7 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19655777/

相关文章:

iOS:写入描述符不允许写入

cookies - 检索到的 twitter oauth token 如何处理?

curl - 获取 401 未经授权 : "Failed to validate oauth signature and token" when running cURL command produced by oauth tool

r - 使用 Twitter(r 包)在 searchTwitter 中进行地理编码和推文

ios - 为什么beginBackgroundTaskWithExpirationHandler提前结束?

ios - spritekit 游戏中的音效开/关

ios - 如何在 bundle 目录iOS中读取 "a b.txt"

ios - 从 presentViewController 推送到 UIViewController

ios - 将 NSJSONSerialization 从 Swift 转换为 Objc C

ipad - 嵌入 YouTube : How to get high quality on iOS 7 ipad