plugin_social

A Flutter plugin for using the native Facebook Account SDK for iOS

How do I use it?

Since sample code is worth more than one page of documentation, here are the usual cases covered:

PluginSocial pluginSocial = new PluginSocial();

//show sign-in with sms
void signInWithSMS() async {
    pluginSocial.signInWithSMS();
 }

//show sign-in with email
void signInWithEmail() async {
    pluginSocial.signInWithEmail();
}

Installation

To get things up and running, you'll have to declare a pubspec dependency in your Flutter project. Also some minimal Android & iOS specific configuration must be done, otherise your app will crash.

On your Flutter project

See the installation instructions on pub.

iOS

This assumes that you've done the "Register and Configure Your App with Facebook AccountKit" step in the the Facebook Login documentation for iOS site.

After you've done that, find out what your Facebook App ID is. You can find your Facebook App ID in your Facebook App's dashboard in the Facebook developer console.

Once you have the Facebook App ID & AccountKit Key figured out, then you'll just have to copy-paste the following to your Info.plist file, before the ending </dict></plist> tags.

/ios/Runner/Info.plist

<key>FacebookAppID</key>
    <string>{xxxxxxxxxxxxxxx}</string>
    <key>AccountKitClientToken</key>
    <string>{xxxxxxxxxxxxxxxxxxxxxxxxxxxx}</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>ak{xxxxxxxxxxxxxxx}</string>
            </array>
        </dict>
    </array>

Done!

On new Flutter project

You can create new project with swift on iOS side:

flutter create -i swift new_project

Go to your new project

cd new_project

Open pubspec.yaml and add this to this file:

dependencies:
  plugin_social: "^0.0.7"

Finally, run your new project.

flutter run

Libraries

plugin_social