How to share UIImage to Facebook using Facebook SDK

195 Views Asked by At

I've noticed that Facebook has changed their policy, that SLComposeViewController doesn't work on sharing photo to Facebook anymore. Can anyone please tell me how to share screenshot to Facebook?

I've coded for capturing screenshot already

CGRect screenRect = [[UIScreen mainScreen] bounds];

UIGraphicsBeginImageContextWithOptions(screenRect.size, NO , 0.0f);

CGContextRef ctx = UIGraphicsGetCurrentContext();

[[UIColor blackColor] set];

CGContextFillRect(ctx, screenRect);


UIWindow *window = [UIApplication sharedApplication].keyWindow;


[window.layer renderInContext:ctx];

UIImage *screengrab = UIGraphicsGetImageFromCurrentImageContext();
0

There are 0 best solutions below