迅捷-如何从iOS到Facebook Messenger共享常规模板内容?

我对Facebook消息共享功能有疑问。

我正在通过Facebook消息共享具有深层链接的标题,图像和字幕。

但是,快速版本没有通用的模板元素。

已弃用吗?

如何与Facebook Messenger共享常规模板内容?

正式文件示例代码

FBSDKShareMessengerURLactionButton *urlButton = [[FBSDKShareMessengerURLactionButton alloc] init];
urlButton.title = @"Visit Facebook";
urlButton.url = [NSURL URLWithString:@"https://www.facebook.com"];

FBSDKShareMessengerGenericTemplateElement *element = [[FBSDKShareMessengerGenericTemplateElement alloc] init];
element.title = @"This is a Cat Picture";
element.subtitle = @"Look at this cat,wow! Amazing.";
element.imageURL = [NSURL URLWithString:@"https://static.pexels.com/photos/126407/pexels-photo-126407.jpeg"];
element.button = urlButton;

FBSDKShareMessengerGenericTemplateContent *content = [[FBSDKShareMessengerGenericTemplateContent alloc] init];
content.pageID = // Your page ID,required for attribution
content.element = element; // <<<< … ? This part is missing in the swift version

FBSDKmessagedialog *messagedialog = [[FBSDKmessagedialog alloc] init];
messagedialog.shareContent = content;

if ([messagedialog canShow]) {
    [messagedialog show];
}

https://developers.facebook.com/docs/sharing/messenger/#-----

song47295743 回答:迅捷-如何从iOS到Facebook Messenger共享常规模板内容?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3152867.html

大家都在问