1
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAcc = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary *options = @{ (NSString *)ACFacebookAppIdKey: @"##########",
(NSString *)ACFacebookPermissionsKey: [NSArray arrayWithObject:@"email"],
(NSString *)ACFacebookAudienceKey: ACFacebookAudienceEveryone,
};
[accountStore requestAccessToAccountsWithType:facebookAcc options:options completion:^(BOOL granted, NSError *error){
if (granted) {
ACAccount *facebookAccount = [[accountStore accountsWithAccountType:facebookAcc] firstObject];
NSLog(@"facebook usre name: %@, Full name: %@", facebookAccount.username, facebookAccount);
}
else if (error)
NSLog(@"Error occured:%@", [error localizedDescription]);
}];
}
和我得到 錯誤發生:在Facebook的服務器無法滿足這個訪問請求:無效的應用程序ID 我應該怎麼寫ACFacebookAppIdKey我應該寫什麼來代替ACFacebookAppIdKey?
請讓你的問題以良好的格式 – 2014-09-22 10:02:38