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

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]