> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/thebergamo/react-native-fbsdk-next/llms.txt
> Use this file to discover all available pages before exploring further.

# ShareContent

> Content types for sharing to Facebook

ShareContent represents the different types of content that can be shared through the Facebook Share Dialog. There are three main content types: links, photos, and videos.

## Types

### ShareContent

```typescript theme={null}
type ShareContent =
  | ShareLinkContent
  | SharePhotoContent
  | ShareVideoContent;
```

## ShareLinkContent

A model for status and link content to be shared.

```typescript theme={null}
type ShareLinkContent = {
  contentType: 'link';
  commonParameters?: ShareContentCommonParameters;
  contentUrl: string;
  contentDescription?: string; // Deprecated from Graph API 2.9
  contentTitle?: string; // Deprecated from Graph API 2.9
  imageUrl?: string; // Deprecated from Graph API 2.9
  quote?: string;
};
```

<ParamField path="contentType" type="'link'" required>
  Must be set to `'link'` to indicate this is link content.
</ParamField>

<ParamField path="contentUrl" type="string" required>
  URL for the content being shared.
</ParamField>

<ParamField path="commonParameters" type="ShareContentCommonParameters">
  Common sharing parameters like hashtag, people tags, and place ID.
</ParamField>

<ParamField path="quote" type="string">
  A predefined quote to attach to this share. If specified, the quote text will render with custom styling on top of the link.
</ParamField>

<ParamField path="contentDescription" type="string">
  The description of the link. If not specified, this field is automatically populated by information scraped from the contentUrl.

  **Deprecated:** This field is deprecated from Graph API 2.9. See [Facebook's changelog](https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations).
</ParamField>

<ParamField path="contentTitle" type="string">
  The title to display for this link.

  **Deprecated:** This field is deprecated from Graph API 2.9. See [Facebook's changelog](https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations).
</ParamField>

<ParamField path="imageUrl" type="string">
  The URL of a picture to attach to this share.

  **Deprecated:** This field is deprecated from Graph API 2.9. See [Facebook's changelog](https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations).
</ParamField>

### Example

```typescript theme={null}
import ShareDialog from 'react-native-fbsdk-next';

const linkContent = {
  contentType: 'link',
  contentUrl: 'https://example.com',
  quote: 'Check out this awesome website!',
  commonParameters: {
    hashtag: '#MyApp',
  },
};

await ShareDialog.show(linkContent);
```

## SharePhotoContent

A model for photo content to be shared.

```typescript theme={null}
type SharePhotoContent = {
  contentType: 'photo';
  commonParameters?: ShareContentCommonParameters;
  contentUrl?: string;
  photos: Array<SharePhoto>;
};
```

<ParamField path="contentType" type="'photo'" required>
  Must be set to `'photo'` to indicate this is photo content.
</ParamField>

<ParamField path="photos" type="Array<SharePhoto>" required>
  Array of photos to be shared. Each photo must be a local file URL when using ShareButton.
</ParamField>

<ParamField path="commonParameters" type="ShareContentCommonParameters">
  Common sharing parameters like hashtag, people tags, and place ID.
</ParamField>

<ParamField path="contentUrl" type="string">
  URL for the content being shared.
</ParamField>

### SharePhoto

```typescript theme={null}
type SharePhoto = {
  imageUrl: string;
  userGenerated?: boolean;
  caption?: string;
};
```

<ParamField path="imageUrl" type="string" required>
  The URL to the photo. When sharing with ShareButton, this must be a local file URI (e.g., `file:///path/to/photo.jpg`), not a web URL.
</ParamField>

<ParamField path="userGenerated" type="boolean">
  Specifies whether the photo was generated by the user or the application.
</ParamField>

<ParamField path="caption" type="string">
  User-generated caption for the photo. The caption must come from the user, as pre-filled content is forbidden by Facebook Platform Policies (2.3).
</ParamField>

### Example

```typescript theme={null}
import ShareDialog from 'react-native-fbsdk-next';

const photoContent = {
  contentType: 'photo',
  photos: [
    {
      imageUrl: 'file:///path/to/photo.jpg',
      caption: 'My awesome photo',
      userGenerated: true,
    },
  ],
  commonParameters: {
    hashtag: '#Photography',
  },
};

await ShareDialog.show(photoContent);
```

## ShareVideoContent

A model for video content to be shared.

```typescript theme={null}
type ShareVideoContent = {
  contentType: 'video';
  commonParameters?: ShareContentCommonParameters;
  contentUrl?: string;
  video: ShareVideo;
  contentDescription?: string;
  contentTitle?: string;
  previewPhoto?: SharePhoto;
};
```

<ParamField path="contentType" type="'video'" required>
  Must be set to `'video'` to indicate this is video content.
</ParamField>

<ParamField path="video" type="ShareVideo" required>
  The video to be shared.
</ParamField>

<ParamField path="commonParameters" type="ShareContentCommonParameters">
  Common sharing parameters like hashtag, people tags, and place ID.
</ParamField>

<ParamField path="contentUrl" type="string">
  URL for the content being shared.
</ParamField>

<ParamField path="contentDescription" type="string">
  Description of the video.
</ParamField>

<ParamField path="contentTitle" type="string">
  Title of the video.
</ParamField>

<ParamField path="previewPhoto" type="SharePhoto">
  The photo that represents the video (thumbnail).
</ParamField>

### ShareVideo

```typescript theme={null}
type ShareVideo = {
  localUrl: string;
};
```

<ParamField path="localUrl" type="string" required>
  The URL to the video. Must point to the location of the video on disk (e.g., `file:///path/to/video.mp4`).
</ParamField>

### Example

```typescript theme={null}
import ShareDialog from 'react-native-fbsdk-next';

const videoContent = {
  contentType: 'video',
  video: {
    localUrl: 'file:///path/to/video.mp4',
  },
  contentTitle: 'My Amazing Video',
  contentDescription: 'Check out this video I created!',
  previewPhoto: {
    imageUrl: 'file:///path/to/thumbnail.jpg',
  },
  commonParameters: {
    hashtag: '#Video',
  },
};

await ShareDialog.show(videoContent);
```

## ShareContentCommonParameters

Common parameters that can be used with all share content types.

```typescript theme={null}
type ShareContentCommonParameters = {
  peopleIds?: Array<string>;
  placeId?: string;
  ref?: string;
  hashtag?: string;
};
```

<ParamField path="peopleIds" type="Array<string>">
  List of IDs for taggable people to tag with this content.
</ParamField>

<ParamField path="placeId" type="string">
  The ID for a place to tag with this content.
</ParamField>

<ParamField path="ref" type="string">
  A value to be added to the referrer URL when a person follows a link from this shared content on feed.
</ParamField>

<ParamField path="hashtag" type="string">
  A hashtag to be added to the share interface. The hashtag must be 32 characters or less.
</ParamField>

### Example

```typescript theme={null}
const commonParameters = {
  hashtag: '#MyApp',
  placeId: '123456789',
  peopleIds: ['987654321', '456789123'],
  ref: 'my-campaign',
};

const shareContent = {
  contentType: 'link',
  contentUrl: 'https://example.com',
  commonParameters,
};
```
