相关疑难解决方法(0)

如何使用SLRequest在Facebook 6中集成Facebook?

我一直在寻找如何使用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)

iphone facebook ios6

21
推荐指数
1
解决办法
2万
查看次数

标签 统计

facebook ×1

ios6 ×1

iphone ×1