Facebook Messenger撰写预定义的消息 [英] Facebook Messenger Compose Predefined Message

查看:286
本文介绍了Facebook Messenger撰写预定义的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fb-messenger://compose打开Facebook Messenger作曲家,但是我无法将预定义的消息放入作曲家.

I am using fb-messenger://compose to open Facebook Messenger Composer, but I can't manage to put predefined message into the composer.

有人知道这些参数吗?

推荐答案

您应该使用FBSDKShareKit通过Messenger发送内容.

You should send content via messenger using FBSDKShareKit.

导入FBSDKShareKit

Import FBSDKShareKit

#import <FBSDKShareKit.h>

创建内容并共享

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://www.url.com"];
content.contentTitle = @"My link!";
content.contentDescription = @"Check out my link!";

[FBSDKMessageDialog showWithContent:content delegate:self];

您还需要使控制器符合FBSDKSharingDelegate

You also need to conform your controller to the FBSDKSharingDelegate

#pragma mark - FBSDKSharingDelegate

- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results {

}

- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error {

}

- (void)sharerDidCancel:(id<FBSDKSharing>)sharer {

}

可用的内容是:

  • FBSDKShareLinkContent
  • FBSDKSharePhotoContent
  • FBSDKShareVideoContent

这篇关于Facebook Messenger撰写预定义的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆