[FBDialogs canPresentShareDialogWithParams : nil]을 제대로 작동시키는 사람이 있습니까? 항상 NO를 반환합니다. params에 무엇을 넣어야합니까? (! 내 자신의 경험)이 SDK에서 HelloFacebookSample에 따르면[FBDialogs canPresentShareDialogWithParams : nil] 작동 방식은 무엇입니까?
if ([FBDialogs canPresentShareDialogWithParams:nil]) {
NSURL* url = [NSURL URLWithString:@"http://www.google.fr"];
[FBDialogs presentShareDialogWithLink:url
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
} else {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *fbComposer = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[fbComposer setInitialText:@"Google rocks !"];
[self presentViewController:fbComposer animated:YES completion:nil];
} else {
[[[UIAlertView alloc] initWithTitle:@"Informations" message:@"You have to be registered into the settings of your phone in order to share" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil] show];
}
}
감사합니다. 나를 위해 일했다 :) –