简体   繁体   中英

Facebook URL sharing issue with Social framework - iOS

I am getting issue for Facebook sharing (with social framework) on when i am appending my URL.

Its giving error on Facebook page. Facebook页面上的共享问题

Code which i am using for sharing content on facebook:

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook
     ])
{
    SLComposeViewController *fbSheetOBJ = [SLComposeViewController
                                              composeViewControllerForServiceType:SLServiceTypeFacebook
                                              ];
    [fbSheetOBJ setInitialText:@""];
    [fbSheetOBJ addURL:[NSURL URLWithString:[[dict_BusinessDetails valueForKey:@"shared_lnks"] valueForKey:@"facebook_link"]]];
    [fbSheetOBJ addURL:[NSURL 
    NSURL *imageURL = [NSURL URLWithString:[dict_BusinessDetails valueForKey:@"business_logo"]];
    NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
    [fbSheetOBJ addImage:[UIImage imageWithData:imageData]];
    [self presentViewController:fbSheetOBJ animated:YES completion:nil];
}

Issue with only iOS devices, Everything is working fine with simulator.

insted of

fbSheetOBJ.addImage(UIImage.imageWithData(imageData))

try using:

bSheetOBJ.addImage(UIImage.pin_decodedImageWithData(imageData))

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM