1

I'm developing a basic gaming app in which i want to share my winning score screen with a default text on facebook page using facebook updated sdk. I wrote code for sharing the screen shot but i'm unable to add default text. I will be very thankful if anyone solves this issue. Here is the code i used to share the screen shot.

- (IBAction)fbSharing:(id)sender {

    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    CGRect rect = [keyWindow bounds];
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [keyWindow.layer renderInContext:context];
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
    photo.image =img;
    photo.userGenerated = YES;

    FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
    content.photos = @[photo];


    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
    dialog.fromViewController = self;
    dialog.shareContent = content;
    dialog.mode = FBSDKShareDialogModeNative;
    dialog.fromViewController = self;


    if (![dialog canShow]) {
        dialog.mode = FBSDKShareDialogModeNative;
    }
    [dialog show];
}

0 Answers0