Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用令牌创建的Twitter帐户在iOS7上失败_Ios_Twitter_Ios7_Acaccount - Fatal编程技术网

使用令牌创建的Twitter帐户在iOS7上失败

使用令牌创建的Twitter帐户在iOS7上失败,ios,twitter,ios7,acaccount,Ios,Twitter,Ios7,Acaccount,我正在开发一个运行在iOS6/7上的应用程序,可以在Twitter上发布自定义视图。为了改善用户体验,如果没有可用的系统帐户,我将向用户提供一个webview,以输入他们的凭据,并按照ACAccountCredential.h中的建议将其存储在ACAccountStore中,然后使用它进行发布 它在iOS6上工作得很好,但在iOS7上共享失败,出现401错误。奇怪的是,ACAccountStore中保存的帐户没有错误,Twitter应用程序可以使用该帐户在Twitter上阅读和发布(无需进一步登

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

它在iOS6上工作得很好,但在iOS7上共享失败,出现401错误。奇怪的是,ACAccountStore中保存的帐户没有错误,Twitter应用程序可以使用该帐户在Twitter上阅读和发布(无需进一步登录),因此我假设该帐户(令牌和令牌机密)工作正常

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上工作。

这个问题将出现在iOS6和iOS7上,因为
/1/statuses/update.json
现在已被弃用。此外,从API的v1.1开始,您必须对所有请求使用HTTPS

您的URL应更改为以下内容:

NSURL *url = [NSURL URLWithString:
              @"https://api.twitter.com/1.1/statuses/update.json"];
有关更多信息,请参阅