facebook_sdk

A Flutter Plugin for integrating the Facebook SDK. For now only ShareLinkContent is implemented. For now only Android. iOS will be next. When everything works as expected i might integrate more sharing options....

Getting Started

Android

Add the following to AndroidManifest.xml and replace {FB_APP_ID} with your Facebook App ID

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
<provider android:authorities="com.facebook.app.FacebookContentProvider{FB_APP_ID}" android:name="com.facebook.FacebookContentProvider" android:exported="true"/>

Add the following to android/app/src/main/res/values/strings.xml

    <string name="app_name">Your App Name</string>
    <string name="facebook_app_id">{FB_APP_ID}</string>
    <string name="fb_login_protocol_scheme">fb{FB_APP_ID}</string>

iOS

Add the following to your Info.plist

	<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb{FB_APP_ID}</string>
            </array>
        </dict>
    </array>
	<key>FacebookAppID</key>
	<string>{FB_APP_ID}</string>
	<key>FacebookDisplayName</key>
	<string>Facebook SDK Example</string>

	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>fbapi</string>
		<string>fb-messenger-share-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
	</array>

Libraries

facebook_sdk

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.