Facebook Messenger撰写预定义消息
我正在使用fb-messenger://撰写打开Facebook Messenger Composer,但我无法将预定义的消息放入composer php。
有人知道参数吗?
您应该使用FBSDKShareKit通过messenger发送内容。
导入FBSDKShareKit
#import
创建内容和分享
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)sharer didCompleteWithResults:(NSDictionary *)results { } - (void)sharer:(id )sharer didFailWithError:(NSError *)error { } - (void)sharerDidCancel:(id )sharer { }
可用内容如下:
- FBSDKShareLinkContent
- FBSDKSharePhotoContent
- FBSDKShareVideoContent
- 为什么Objective-C / Swift中的asynchronousnetworkingtesting困难?
- 用iOS SDK 4.2编译libpq
- 使用CoreBluetooth(BLE)将数据从CentralManager发送到PeripheralManager
- 有没有办法将UIPickerView添加到Swift中的UIAlertController(Alert或ActionSheet)?
- 自动布局约束的设备之间的间距不一致
- 添加Swift项目实际上增加了大小。 如何以及何时可以避免
- 根据所选的MKAnnotationViewdynamic更改leftCalloutAccessoryView
- 理解像tableView这样的函数中的Swift参数表示法
- iOS 8的Xcode 6.1 EXC_BREAKPOINT(SIGTRAP)只在捆绑应用程序