gpt4 book ai didi

ios - Facebook Messenger 撰写预定义消息

转载 作者:可可西里 更新时间:2023-11-01 04:25:07 26 4
gpt4 key购买 nike

我正在使用 fb-messenger://compose 打开 Facebook Messenger Composer,但我无法将预定义的消息放入 composer。

有人知道参数吗?

最佳答案

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

导入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];

您还需要使您的 Controller 符合 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

关于ios - Facebook Messenger 撰写预定义消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27064802/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com