After the iOS 11 relase, the SLComposeViewController is depraceted/not allowed sharing. So iOS developers have to use native Facebook and Twitter SDK to share content. And my problems is raising from this point.
I have been developing a new app which is needed facebook sharing with link, photo and description. i have done separately sharing with photo or link with native FBSDK. But i want to ask you, anyone know how can i use photo and link and description in the same Facebook Dialog. Because in my scenario, i have to share discount detail with discounting shop web site(https://emregurses.com/....../shoes), and discount foto(shoes or bag) and the detail text(Hurry up, you can buy until the midnight)
You can see below codes which i use to share separately.
Photo Share
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
shareButton = [[FBSDKShareButton alloc] init];
if (shareImage) {
FBSDKSharePhoto *sharePhoto = [[FBSDKSharePhoto alloc] init];
sharePhoto.caption = facebookTitle;
sharePhoto.image = shareImage;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[sharePhoto];
}
shareButton.shareContent = content;
[shareButton sendActionsForControlEvents: UIControlEventTouchUpInside];
Link Share
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
shareButton = [[FBSDKShareButton alloc] init];
if (facebookUrl) {
content.contentURL = [NSURL URLWithString:facebookUrl];
}else{
content.contentURL = [NSURL URLWithString:@"https://fastpay.com.tr/"];
}
shareButton.shareContent = content;
[shareButton sendActionsForControlEvents: UIControlEventTouchUpInside];
But i want to share all of them in the same FBShare dialog as the before SLComposeViewController. Also imageURL property is deprecated the new SDK.
@property (nonatomic, readonly) NSURL *imageURL
DEPRECATED_MSG_ATTRIBUTE("`imageURL` is deprecated from Graph API 2.9");