Inherits from NSObject
Declared in FBSDKMessengerSharer.h

Overview

@class FBSDKMessengerSharer

@abstract The FBSDKMessengerSharer is used to share media from apps into Messenger. The underlying mechanism used to share data between apps is UIPasteboard

@discussion - FacebookAppID must be set in the your app’s Info.plist with the Facebook App Id - Any existing data in the system’s public pasteboard will get overwritten with the shared media - Once the data is shared in Messenger, the pasteboard with be cleared - The following strings need to be translated in your app: NSLocalizedString(@“Get Messenger”, @“Alert title telling a user they need to install Messenger”) NSLocalizedString(@“You are using an older version of Messenger that does not support this feature.”, @“Alert message when an old version of messenger is installed”) NSLocalizedString(@“Not Now”, @“Button label when user doesn’t want to install Messenger”) NSLocalizedString(@“Install”, @“Button label to install Messenger”) NSLocalizedString(@“Send”, @“Button label for sending a message”)

Class Methods

messengerPlatformCapabilities

@abstract This method checks the currently installed version of Messenger to see what SDK capabilities it has

+ (FBSDKMessengerPlatformCapability)messengerPlatformCapabilities

Return Value

bitmask of the Messenger capabilities

Discussion

@discussion Before sharing any media, first use this bitmask to check to see if it can be shared to Messenger

@deprecated This method is deprecated as of iOS 9

Declared In

FBSDKMessengerSharer.h

openMessenger

@abstract Call this method to open Messenger

+ (void)openMessenger

Declared In

FBSDKMessengerSharer.h

shareAnimatedGIF:withMetadata:withContext:

@abstract Call this method to open Messenger and share an animated GIF.

+ (void)shareAnimatedGIF:(NSData *)animatedGIFData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context

Parameters

animatedGIFData

The animated GIF to be shared in Messenger

metadata

Additional optional information to be sent to Messenger which is sent back to the user’s app when they reply to an attributed message. This may be nil.

context

The way the content is to be shared in Messenger. If nil, a standard share will take place.

Discussion

@deprecated use shareAnimatedGIF:withOptions: instead

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareAnimatedGIF:withOptions:

@abstract Call this method to open Messenger and share an animated GIF.

+ (void)shareAnimatedGIF:(NSData *)animatedGIFData withOptions:(FBSDKMessengerShareOptions *)options

Parameters

animatedGIFData

The animated GIF to be shared in Messenger

options

Additional optional parameters that affect the way the content is shared

Discussion

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareAnimatedWebP:withMetadata:withContext:

@abstract Call this method to open Messenger and share an animated GIF.

+ (void)shareAnimatedWebP:(NSData *)animatedWebPData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context

Parameters

animatedWebPData

The animated WebP image to be shared in Messenger

metadata

Additional optional information to be sent to Messenger which is sent back to the user’s app when they reply to an attributed message. This may be nil.

context

The way the content is to be shared in Messenger. If nil, a standard share will take place.

Discussion

@deprecated use shareAnimatedWebP:withOptions: instead

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareAnimatedWebP:withOptions:

@abstract Call this method to open Messenger and share an animated GIF.

+ (void)shareAnimatedWebP:(NSData *)animatedWebPData withOptions:(FBSDKMessengerShareOptions *)options

Parameters

animatedWebPData

The animated WebP image to be shared in Messenger

options

Additional optional parameters that affect the way the content is shared

Discussion

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareAudio:withMetadata:withContext:

@abstract Call this method to open Messenger and share an audio file.

+ (void)shareAudio:(NSData *)audioData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context

Parameters

audioData

The audio to be shared in Messenger

metadata

Additional optional information to be sent to Messenger

Discussion

@deprecated use shareAudio:withOptions: instead

@discussion Note that there’s no way to send an AVAsset between apps, so you may need to serialize your AVAsset to a file, and get an NSData representation of the video via [NSData dataWithContentsOfFile:filepath];

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareAudio:withOptions:

@abstract Call this method to open Messenger and share an audio file.

+ (void)shareAudio:(NSData *)audioData withOptions:(FBSDKMessengerShareOptions *)options

Parameters

audioData

The audio to be shared in Messenger

options

Additional optional parameters that affect the way the content is shared

Discussion

@discussion Note that there’s no way to send an AVAsset between apps, so you may need to serialize your AVAsset to a file, and get an NSData representation of the video via [NSData dataWithContentsOfFile:filepath];

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareImage:withMetadata:withContext:

@abstract Call this method to open Messenger and share an image.

+ (void)shareImage:(UIImage *)image withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context

Parameters

image

The image to be shared in Messenger

metadata

Additional optional information to be sent to Messenger which is sent back to the user’s app when they reply to an attributed message. This may be nil.

context

The way the content is to be shared in Messenger. If nil, a standard share will take place.

Discussion

@deprecated use shareImage:withOptions: instead

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareImage:withOptions:

@abstract Call this method to open Messenger and share an image.

+ (void)shareImage:(UIImage *)image withOptions:(FBSDKMessengerShareOptions *)options

Parameters

image

The image to be shared in Messenger

options

Additional optional parameters that affect the way the content is shared

Discussion

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareVideo:withMetadata:withContext:

@abstract Call this method to open Messenger and share a video.

+ (void)shareVideo:(NSData *)videoData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context

Parameters

videoData

The image to be shared in Messenger

metadata

Additional optional information to be sent to Messenger which is sent back to the user’s app when they reply to an attributed message. This may be nil.

context

The way the content is to be shared in Messenger. If nil, a standard share will take place.

Discussion

@deprecated use shareVideo:withOptions: instead

@discussion Note that there’s no way to send an AVAsset between apps, so you may need to serialize your AVAsset to a file, and get an NSData representation of the video via [NSData dataWithContentsOfFile:filepath];

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h

shareVideo:withOptions:

@abstract Call this method to open Messenger and share a video.

+ (void)shareVideo:(NSData *)videoData withOptions:(FBSDKMessengerShareOptions *)options

Parameters

videoData

The image to be shared in Messenger

options

Additional optional parameters that affect the way the content is shared

Discussion

@discussion Note that there’s no way to send an AVAsset between apps, so you may need to serialize your AVAsset to a file, and get an NSData representation of the video via [NSData dataWithContentsOfFile:filepath];

If there is not an installed version of Messenger on the device that supports the share, an alert will be presented to notify the user.

Declared In

FBSDKMessengerSharer.h