Platforms and setup
Native platforms: ios, android, windows.
Public actions
Facebook.openFacebook.openProfileByIdFacebook.openProfileByUsernameFacebook.openPageFacebook.openGroupFacebook.openEvent
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
fallbackToStore | bool | No | false |
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
id | String | Yes | — |
fallbackToStore | bool | No | false |
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
username | String | Yes | — |
fallbackToStore | bool | No | false |
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
pageId | String | Yes | — |
fallbackToStore | bool | No | false |
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
groupId | String | Yes | — |
fallbackToStore | bool | No | false |
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.
| Parameter | Type | Required | Default |
|---|---|---|---|
eventId | String | Yes | — |
fallbackToStore | bool | No | false |
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:
Native App Deep Links
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}