meta_sdk 1.2.0
meta_sdk: ^1.2.0 copied to clipboard
A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14. Modernized for Meta SDK.
Meta SDK for Flutter #
Meta SDK (formerly meta_sdk) is a modernized Flutter plugin to integrate the latest Meta (Facebook) SDK into your applications. It supports fetching Deep Links, Deferred Deep Links, and logging App Events for both iOS and Android.
This version is maintained by amajust and has been updated to support Flutter 3.x, Dart 3 (Sound Null Safety), and the latest Android/iOS platform requirements as of 2026.
Features #
- ✅ Fetch Deep Links and Deferred Deep Links.
- ✅ Log standard and custom App Events.
- ✅ Support for iOS 14+ Advertiser Tracking.
- ✅ Modernized for Flutter 3.x and Dart 3.
- ✅ Latest Meta SDK (v17.x).
Prerequisites #
- Create a Meta App at the Meta for Developers portal.
- Obtain your App ID and Display Name.
Platform Configuration #
Android #
-
Add your App ID and Client Token to
/android/app/src/main/res/values/strings.xml:<string name="facebook_app_id">[APP_ID]</string> <string name="fb_login_protocol_scheme">fb[APP_ID]</string> <string name="facebook_client_token">[CLIENT_TOKEN]</string> -
Update
AndroidManifest.xmlwith the meta-data tag inside the<application>element:<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/> -
Ensure you have the Internet permission:
<uses-permission android:name="android.permission.INTERNET"/>
iOS #
Update your Info.plist with the following keys:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb[APP_ID]</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>[APP_ID]</string>
<key>FacebookClientToken</key>
<string>[CLIENT_TOKEN]</string>
<key>FacebookDisplayName</key>
<string>[DISPLAY_NAME]</string>
<key>FacebookAutoLogAppEventsEnabled</key>
<true/>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<true/>
Usage #
Initialize SDK #
final facebookSdk = MetaSdk();
await facebookSdk.initializeSDK();
Log App Events #
await facebookSdk.logEvent(
eventName: "button_clicked",
parameters: {
'button_id': 'main_cta',
},
);
Fetch Deep Links #
facebookSdk.onDeepLinkReceived.listen((event) {
print("Deep Link Received: $event");
});
Credits #
Originally created by saadfarhan124. Modernized and maintained by amajust.
GitHub