> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep Link & Sharing

> Manage the URL and deep link structure for shareable content and profile.

<Info>
  Configure domain and URL patterns for content and profile sharing, enabling deep linking into your app.
</Info>

<CardGroup cols={2}>
  <Card title="Configure Domain" icon="globe">Set your base URL for sharing.</Card>
  <Card title="URL Patterns" icon="link">Define structures for posts, profiles, etc.</Card>
  <Card title="Share Links" icon="share">Users can copy/share from the UI.</Card>
  <Card title="App Integration" icon="code">Handle incoming deep links in your app.</Card>
</CardGroup>

## Overview

Admins configure URL and deep link patterns for posts, live streams, profiles, and communities via the Social+ console. Once set up, users and managers can copy and share direct links for any of these items—using structures that match their brand. Social+ generates the links and makes them available for sharing, while our customer’s developers implement how these deep links are processed and which screens they open in their app.

## Quick Start

<Steps>
  <Step title="Navigate">Console → Settings → Deep link and sharing.</Step>
  <Step title="Configure Domain">Set your base domain for sharing, ensure it matches your application's domain.</Step>
  <Step title="Configure URL Patterns">Toggle to enable URL patterns for different content types.</Step>
  <Step title="Preview">Check your URL pattern with base domain in preview.</Step>
  <Step title="Save Changes">Confirm your changes and save.</Step>
</Steps>

## URL Pattern Configuration

<AccordionGroup>
  <Accordion title="Domain URL" icon="globe">
    Enter your primary web domain. This will be the base for all generated web links. For example: `https://myapp.com`
  </Accordion>

  <Accordion title="Post URL Pattern" icon="file">
    Enter the path for web and mobile deep links. Use `{postId}` as a placeholder. For example: `/posts/{postId}`
  </Accordion>

  <Accordion title="Livestreams URL Pattern" icon="video">
    Enter the path for web and mobile deep links. Use `{livestreamId}` as a placeholder. For example: `/livestreams/{livestreamId}`
  </Accordion>

  <Accordion title="Communities URL Pattern" icon="users">
    Enter the path for web and mobile deep links. Use `{communityId}` as a placeholder. For example: `/communities/{communityId}`
  </Accordion>

  <Accordion title="Users URL Pattern" icon="user">
    Enter the path for web and mobile deep links. Use `{userId}` as a placeholder. For example: `/users/{userId}`
  </Accordion>
</AccordionGroup>

## SDK & UIKit Integration

The URL patterns you configure in the console are stored in the system and accessed by the SDK and UIKit at runtime to generate shareable links.

### SDK Integration

The SDK provides functions to fetch the link patterns stored in the system, allowing you to retrieve the configured URL patterns for each content type programmatically.

**Use the SDK to:**

* Retrieve domain URL and URL patterns for posts, livestreams, communities, and users
* Integrate custom sharing functionality in your app
* Build shareable links dynamically based on your configured patterns

### UIKit Integration

UIKit leverages the SDK to obtain link patterns for each content type from the system. Share buttons appear automatically in the UI once valid link patterns are configured in the console.

**How UIKit sharing works:**

<Steps>
  <Step title="Link Pattern Retrieval">
    UIKit fetches the configured URL patterns via SDK when content is displayed
  </Step>

  <Step title="Share Button Visibility">
    Share buttons only appear when valid link patterns exist in the system
  </Step>

  <Step title="Runtime Link Generation">
    When a user clicks the share button, the content ID is applied to the link pattern to generate a complete, shareable URL
  </Step>

  <Step title="Native Sharing">
    On native platforms (iOS/Android), clicking share triggers the OS's native link sharing behavior
  </Step>
</Steps>

<Note>
  **Important - URL Pattern Usage in UIKit**: UIKit only uses the **Post**, **Community**, and **User** URL patterns. The **Livestream** URL pattern is not used in UIKit because livestreams created in UIKit are implemented as posts. When users share a livestream post, the 'post' content type pattern is used for link generation.
</Note>

## Best Practices

<AccordionGroup>
  <Accordion title="App Routing" icon="code">
    While Social+ generates links based on your patterns, you must implement in-app routing. Your app is responsible for handling incoming URLs, navigating to the correct content, and managing access for private items, like prompting non-members to log in.
  </Accordion>

  <Accordion title="Consistent URL Structure" icon="link">
    Maintain a consistent and predictable URL structure across your application. This improves user experience and makes your links more shareable and understandable.
  </Accordion>

  <Accordion title="Handling Private Content" icon="lock">
    For links to private content (e.g., private communities, user-specific content), ensure your app checks user permissions. If the user doesn't have access, redirect them to a login page or a "request access" screen instead of showing an error.
  </Accordion>
</AccordionGroup>

## Troubleshooting

| Symptom                      | Cause                             | Resolution                                                                                                              |
| ---------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Links don't open the app     | App not configured for deep links | Ensure your iOS (Universal Links) and Android (App Links) projects are correctly configured to handle your domain.      |
| Links go to the wrong screen | Incorrect routing logic in app    | Review your app's deep link handling code to ensure it correctly parses the URL and navigates to the right destination. |
| 404 errors on shared links   | Incorrect domain or pattern       | Double-check the Domain URL and URL Patterns in the console settings to ensure they match your website's structure.     |

## Related Topics

<CardGroup cols={2}>
  <Card title="Branding" icon="image" href="./branding">Customize your app's look and feel.</Card>
  <Card title="Security" icon="shield" href="./security">Harden access to Social+ APIs.</Card>
</CardGroup>
