I create application with feature 'shared with facebook' I use this code for make a facebook sharing
[facebookViewController setInitialText:[NSString stringWithFormat:@"via %@", self.randomGame.name]];
NSLog(@"%@", self.resultImageView.image);
[facebookViewController addImage:self.resultImageView.image];
[facebookViewController setCompletionHandler:^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled) {
NSLog(@"Dialog Did Cancel");
}
}];
[self presentViewController:facebookViewController animated:YES completion:nil];
I already have allocation/initialization facebookViewController object with SLComposeViewController.
first time I share there is no problem. But, I share second time I get a shadow screen like this
can anyone help ? Thanks for advance.
i am not sure but every time you present the facebook popover you also need to dismiss it in the completion block like
[facebookViewController dismissViewControllerAnimated:YES completion:Nil];
hope it helps
I done it with code
facebookViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[facebookViewController setInitialText:[NSString stringWithFormat:@"via %@", self.randomGame.name]];
[facebookViewController addImage:self.resultImageView.image];
[self presentViewController:facebookViewController animated:YES completion:nil];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.