Reputation: 25968
I am getting issue for Facebook sharing (with social framework) on when i am appending my URL.
Its giving error on Facebook page.
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.
Upvotes: 0
Views: 269
Reputation: 160
insted of
fbSheetOBJ.addImage(UIImage.imageWithData(imageData))
try using:
bSheetOBJ.addImage(UIImage.pin_decodedImageWithData(imageData))
Upvotes: 0