在使用 SLRequest 与 Facebook 集成时是否必须使用app Id
,实际上我没有App id
,所以是否可以使用 SLRequest 集成 Facebook,而不使用app id
,因为我没有注册的 iTunes 帐户?
-(void)viewDidLoad
{
self.accountStore = [[ACAccountStore alloc]init];
ACAccountType *FBaccountType= [self.accountStore accountTypeWithAccountTypeIdentifier:
ACAccountTypeIdentifierFacebook];
NSString *key = @"987654";
NSDictionary *dictFB = //use ACAccountStore to help create your dictionary
[self.accountStore requestAccessToAccountsWithType:FBaccountType options:dictFB
completion: ^(BOOL granted, NSError *e) {
if (granted) {
NSArray *accounts = [self.accountStore accountsWithAccountType:FBaccountType];
//it will always be the last object with SSO
self.facebookAccount = [accounts lastObject];
}
else {
//Fail gracefully...
NSLog(@"error getting permission %@",e);
}
}];