我一直在寻找如何使用SLRequests了解如何在iOS6中集成Facebook.经过一番研究,我能够做到这一点.这里有一些代码片段,展示了它是如何完成的.
{
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
__block ACAccount *facebookAccount = nil;
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
// Specify App ID and permissions
NSDictionary *options = @{
ACFacebookAppIdKey: @"012345678912345",
ACFacebookPermissionsKey: @[@"publish_stream", @"publish_actions"],
ACFacebookAudienceKey: ACFacebookAudienceFriends
};
[accountStore requestAccessToAccountsWithType:facebookAccountType
options:options completion:^(BOOL granted, NSError *e)
{
if (granted)
{
NSArray *accounts = [accountStore accountsWithAccountType:facebookAccountType];
facebookAccount = [accounts lastObject];
}
else
{
// Handle Failure
}
}];
NSDictionary *parameters = @{@"message": @"My first iOS 6 Facebook posting "};
NSURL *feedURL = [NSURL URLWithString:@"https://graph.facebook.com/me/feed"]; …
Run Code Online (Sandbox Code Playgroud) 我在尝试在Amazon S3服务器上下载图像时遇到了问题.
我收到以下错误:
Error Domain=AFNetworkingErrorDomain Code=-1016 "Request failed: unacceptable content-type: binary/octet-stream"
Run Code Online (Sandbox Code Playgroud)
有人有想法吗?