这是我的代码,但越来越无效publish_streem
。有没有什么方法可以在 facebook 上分享而不在 ios 中显示分享对话框?
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [accountStore
accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
//ACAccount *facebookAccount;
// Specify App ID and permissions
NSDictionary *options = @{ACFacebookAppIdKey:@"565048226932112",ACFacebookPermissionsKey:@[@"publish_stream", @"publish_actions"],ACFacebookAudienceKey:ACFacebookAudienceFriends};
[accountStore requestAccessToAccountsWithType:facebookAccountType options:options completion:^(BOOL granted, NSError *error) {
if (granted) {
NSArray *accounts = [accountStore accountsWithAccountType:facebookAccountType];
}
else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"%@",error] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
// NSLog(@"Error :%@",error);
}
}];