flutter_facebook_plugin 0.0.2
flutter_facebook_plugin: ^0.0.2 copied to clipboard
Flutter Facebook to Log in and Sharing dialogs
flutter_facebook_plugin #
Flutter Facebook to Login and Sharing dialogs
Add easily Facebook login to your application and after succesful login call the link Facebook sharing dialog.
Getting Started #
To use this plugin, add flutter_facebook_plugin
as a dependency in your pubspec.yaml file.
Setup android #
- Go to Facebook Login for Android - Quickstart page.
- You need to complete Step 1
- Skip Step 2 and Step 3
Complete Step 4. Edit Your Resources and Manifest
- Add values to
/android/app/src/main/res/values/strings.xml
(create file if it doesn't exist)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="facebook_app_id">1234</string>
<string name="fb_login_protocol_scheme">fb1234</string>
</resources>
- Add a
meta-data
element and activities toandroid/app/src/main/AndroidManifest.xml
, sectionapplication
:
<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" />
<activity android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
- Add a uses-permission element to the manifest after the application element:
<uses-permission android:name="android.permission.INTERNET"/>
- Complete Step 5. Associate Your Package Name and Default Class with Your App.
- Set
Package Name
- your package name for Android application (attributepackage
inAndroidManifest.xml
). - Set
Default Activity Class Name
- your main activity class (with package). By default it would becom.yourcompany.yourapp.MainActivity
. - Click "Save".
-
Complete Step 6. Provide the Development and Release Key Hashes for Your App.
-
Skip the next steps.
Setup iOS #
- Go to Facebook Login for iOS - Quickstart page.
- Complete Step 1. Select an app or create a new app. If you already created an app during an Android setup process than use it.
- Skip Step 2 and Step 3