Question

For an app I'm working on I'm integrating different social services the user can select to share the content created using the app.

What I'm trying to understand is if the facebook-messenger app expose an URL scheme that can be used to perform some action (basically texting one of his/her friend), or if there is a specific UTI that can be used in conjunction with the UIDocumentInteractionController.

Thanks in advance for any help / hint / suggestion

Was it helpful?

Solution 2

Facebook Messenger URL scheme on iOS is fb-messenger://, I don't know if it's possible to open a composer that will let you choose contacts or pre fill it with a message.

You can open a conversation if you know the Facebook user ID: fb-messenger://user-thread/[facebook-user-id]

OTHER TIPS

You cannot compose message but you can send a link, photo or video via messenger. Facebook provides API for that.

Import FBSDKShareKit

#import <FBSDKShareKit.h>

Create content and share

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

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 {

}

Available contents are:

  • FBSDKShareLinkContent
  • FBSDKSharePhotoContent
  • FBSDKShareVideoContent
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top