У меня есть вопрос о функции обмена сообщениями Facebook.
Я делаю функцию, чтобы поделиться заголовком, изображением, субтитром с глубокой ссылкой через сообщение Facebook.
Но, в быстрой версии нет общего элемента шаблона.
Является ли это устаревшим?
как поделиться общим содержимым шаблона в мессенджере facebook?
Код примера официального документа
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/#-----