Facebook Messenger撰写预定义消息

问题描述:

我正在使用fb-messenger://撰写来打开Facebook Messenger Composer,但我无法设置将预定义的消息放入作曲家。Facebook Messenger撰写预定义消息

有人知道参数吗?

+0

有已在处理这几个堆栈溢出线程: http://stackoverflow.com/questions/25467445/custom-uri-schemes-for -the-facebook-messenger http://stackoverflow.com/questions/20059001/custom-url-to-launch-facebook-messenger-on-ios(你可能需要使用Facebook SDK) – cdstamper 2014-11-21 16:37:43

+0

我正在尝试同样的事情。你是否设法发布预定义的消息? – Hassy31 2015-02-10 10:47:01

+0

没有。我们无法解决它。 FB更改了URL Schemes :( – 2015-03-07 12:12:08

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

进口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

#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
+0

感谢兄弟,我已经与Messenger SDK打了几天了。不要以为用户的消息对话!甜美 – YuviGr 2015-07-21 16:16:48