DEEPLINKX / app

Facebook

Facebook actions, setup, native platforms, and fallback options.

DeeplinkX 1.5.8 · Source

Platforms and setup

Native platforms: ios, android, windows.

Public actions

Facebook.open

factory Facebook.open({final bool fallbackToStore = false})

Launch with DeeplinkX.launchApp. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
fallbackToStoreboolNofalse

Exact source

Facebook.openProfileById

static FacebookOpenProfileByIdAction openProfileById({ required final String id, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
idStringYes—
fallbackToStoreboolNofalse

Exact source

Facebook.openProfileByUsername

static FacebookOpenProfileByUsernameAction openProfileByUsername({ required final String username, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
usernameStringYes—
fallbackToStoreboolNofalse

Exact source

Facebook.openPage

static FacebookOpenPageAction openPage({ required final String pageId, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
pageIdStringYes—
fallbackToStoreboolNofalse

Exact source

Facebook.openGroup

static FacebookOpenGroupAction openGroup({ required final String groupId, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
groupIdStringYes—
fallbackToStoreboolNofalse

Exact source

Facebook.openEvent

static FacebookOpenEventAction openEvent({ required final String eventId, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android, windows. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
eventIdStringYes—
fallbackToStoreboolNofalse

Exact source

Provider setup and examples

DeeplinkX provides comprehensive support for Facebook deep linking actions.

Available Actions

Launch Facebook App

final deeplinkX = DeeplinkX();

// Simple launch
await deeplinkX.launchApp(Facebook.open());

// Launch with store fallback if not installed
await deeplinkX.launchApp(Facebook.open(fallbackToStore: true));

// Launch with fallback disabled
await deeplinkX.launchApp(Facebook.open(), disableFallback: true);

Open Profile by ID Action

final deeplinkX = DeeplinkX();

// Simple action
await deeplinkX.launchAction(Facebook.openProfileById(id: 'profileId')); // Facebook numeric ID (e.g. '123456789')

// Action with store fallback if not installed
await deeplinkX.launchAction(Facebook.openProfileById(
  id: 'profileId', // Facebook numeric ID (e.g. '123456789')
  fallbackToStore: true,
));

// Action with fallback disabled
await deeplinkX.launchAction(
  Facebook.openProfileById(id: 'profileId'), // Facebook numeric ID (e.g. '123456789')
  disableFallback: true,
);

Open Profile by Username Action

final deeplinkX = DeeplinkX();

// Simple action
await deeplinkX.launchAction(Facebook.openProfileByUsername(username: 'username')); // Facebook username (e.g. 'zuck' for Mark Zuckerberg)

// Action with store fallback if not installed
await deeplinkX.launchAction(Facebook.openProfileByUsername(
  username: 'username', // Facebook username (e.g. 'zuck' for Mark Zuckerberg)
  fallbackToStore: true,
));

// Action with fallback disabled
await deeplinkX.launchAction(
  Facebook.openProfileByUsername(username: 'username'), // Facebook username (e.g. 'zuck' for Mark Zuckerberg)
  disableFallback: true,
);

Open Page Action

final deeplinkX = DeeplinkX();

// Simple action
await deeplinkX.launchAction(Facebook.openPage(pageId: 'pageId')); // Facebook page ID (e.g. 'facebookapp' for Facebook's official page)

// Action with store fallback if not installed
await deeplinkX.launchAction(Facebook.openPage(
  pageId: 'pageId', // Facebook page ID (e.g. 'facebookapp' for Facebook's official page)
  fallbackToStore: true,
));

// Action with fallback disabled
await deeplinkX.launchAction(
  Facebook.openPage(pageId: 'pageId'), // Facebook page ID (e.g. 'facebookapp' for Facebook's official page)
  disableFallback: true,
);

Open Group Action

final deeplinkX = DeeplinkX();

// Simple action
await deeplinkX.launchAction(Facebook.openGroup(groupId: 'groupId')); // Facebook group ID (e.g. '231104380821004' for Flutter Community group)

// Action with store fallback if not installed
await deeplinkX.launchAction(Facebook.openGroup(
  groupId: 'groupId', // Facebook group ID (e.g. '231104380821004' for Flutter Community group)
  fallbackToStore: true,
));

// Action with fallback disabled
await deeplinkX.launchAction(
  Facebook.openGroup(groupId: 'groupId'), // Facebook group ID (e.g. '231104380821004' for Flutter Community group)
  disableFallback: true,
);

Open Event Action

final deeplinkX = DeeplinkX();

// Simple action
await deeplinkX.launchAction(Facebook.openEvent(eventId: 'eventId')); // Facebook event ID (e.g. '10155945715431729' for F8 Conference)

// Action with store fallback if not installed
await deeplinkX.launchAction(Facebook.openEvent(
  eventId: 'eventId', // Facebook event ID (e.g. '10155945715431729' for F8 Conference)
  fallbackToStore: true,
));

// Action with fallback disabled
await deeplinkX.launchAction(
  Facebook.openEvent(eventId: 'eventId'), // Facebook event ID (e.g. '10155945715431729' for F8 Conference)
  disableFallback: true,
);

Parameter Validations

ID Validation

Facebook IDs must be valid numeric or alphanumeric identifiers assigned by Facebook.

Username Validation

Facebook usernames must follow these rules:

  • Length: 5-50 characters
  • Can contain letters, numbers, and periods
  • Cannot contain spaces or special characters
  • Cannot start or end with a period
  • Cannot contain consecutive periods

Platform-Specific Configuration

iOS

Add the following to your ios/Runner/Info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fb</string>
    <string>itms-apps</string>
</array>

Android

Add the following to your android/app/src/main/AndroidManifest.xml inside the <queries> tag:

<queries>
    <!-- For Facebook app -->
    <package android:name="com.facebook.katana" />
    
    <!-- For Play Store fallback (if using fallbackToStore) -->
    <package android:name="com.android.vending" />
    
    <!-- For web fallback (required) -->
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
    </intent>
</queries>

URL Schemes

DeeplinkX uses the following URL schemes for Facebook:

When Facebook is installed, the following schemes are used:

  • fb:// - Native Facebook URL scheme
  • For profiles by ID: fb://profile/{id}
  • For profiles by username: https://www.facebook.com/{username} (uses universal link)
  • For pages: https://www.facebook.com/{pageId} (uses universal link)
  • For groups: https://www.facebook.com/groups/{groupId} (uses universal link)
  • For events: https://www.facebook.com/events/{eventId} (uses universal link)

Web Fallback URLs

When Facebook is not installed, DeeplinkX automatically falls back to:

  • https://www.facebook.com - Official Facebook web URL
  • For profiles by ID: https://www.facebook.com/{id}
  • For profiles by username: https://www.facebook.com/{username}
  • For pages: https://www.facebook.com/{pageId}
  • For groups: https://www.facebook.com/groups/{groupId}
  • For events: https://www.facebook.com/events/{eventId}