fb_accountkit_flutter 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

Welcome to Facebook Account Kit Flutter Version! #

What's that? #

As you all know, Facebook Account Kit - powered by Facebook - lets you quickly register for and login to your app by using just user's phone number. It's reliable and easy to integrate. Now it's is available in Flutter.

Let's prepare some your own Facebook Developer information !!! #

Note: If your project just provide for only 1 platform. You can skip the other part. #

*** For Android Configuration: #

  • Open your project, create strings.xml file at this path: \android\app\src\main\res
  • Add 2 variables like below:
<?xml version="1.0" encoding="utf-8"?>  
<resources>  
    <string name="FACEBOOK_APP_ID" translatable="false">[YOUR_FACEBOOK_APP_ID]</string>  
    <string name="ACCOUNT_KIT_CLIENT_TOKEN" translatable="false">[ACCOUNT_KIT_CLIENT_TOKEN]</string>  
</resources>

About the Facebook App ID and Account Kit Client Token, please keep reading

  • Set up your AndroidManifest.xml in /android/app/src/main. Full code here.

*** For iOS Configuration: #

  • Open ios\Runner\Info.plist by right click -> open by source code
  • Copy and paste this inside the space between <dict></dict> tag.
	<key>FacebookAppID</key>
    <string>[YOUR_FACEBOOK_APP_ID]</string>
    <key>AccountKitClientToken</key>
    <string>[ACCOUNT_KIT_CLIENT_TOKEN]</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>ak[YOUR_FACEBOOK_APP_ID]</string>
            </array>
        </dict>
    </array>

About Facebook App Id and Account Kit Client Token: #

YOUR_FACEBOOK_APP_ID: you can get it in picture below and simply press to copy YOUR_FACEBOOK_APP_ID ACCOUNT_KIT_CLIENT_TOKEN: ACCOUNT_KIT_CLIENT_TOKEN

... It's done for configuration !! Let's go back to Flutter main.dart

How to use? #

It's very easy !!!

1. Add dependency to your pubspec.yaml file: #

dependencies:  
    fb_accountkit_flutter: ^0.0.2

And do not forget to call flutter get to get the dependency in pub.dev

2. Import to your code: #

import 'package:fb_accountkit_flutter/fb_accountkit_flutter.dart';

3. Call open AccountKit whenever you want: #

Result result = await FbAccountkitFlutter.startAuthentication()

Example Function #

import 'dart:async';  
import 'package:flutter/services.dart';  
import 'package:fb_accountkit_flutter/fb_accountkit_flutter.dart';

Future<void> openFacebookActivity() async {  
  Result result;  
  
  try {  
    FbAccountkitFlutter.defaultCountryCode = "[YOUR DEFAULT COUNTRY CODE]"; // Ex:  US, AL etc.  
	// Find more here : https://developers.facebook.com/docs/accountkit/countrycodes/  
	FbAccountkitFlutter.codeIso = "[YOUR ISO CODE]"; // Ex: 93, 355 etc.  
	// Find Dialing Code here : https://developers.facebook.com/docs/accountkit/countrycodes/  
	FbAccountkitFlutter.countryCode = "[YOUR COUNTRY CODE]";  
    // Find A 3 in here : http://kirste.userpage.fu-berlin.de/diverse/doc/ISO_3166.html  
	
	// Optional  
	FbAccountkitFlutter.phone = "[INITIAL PHONE]";  
	
	// Request open accountkit  
	result = await FbAccountkitFlutter.startAuthentication();  
  
  } on PlatformException catch(e) {  
    print(e);  
    result = null;  
  }  
  
}

You can read the full code in the example package also.

Happy Coding ! #

0.0.1 #

Initial release.

0.0.2 #

Ready for usage

1.0.0 #

Optimize, Clean to high. Update Document.

example/README.md

fb_accountkit_flutter_example #

Demonstrates how to use the fb_accountkit_flutter plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fb_accountkit_flutter: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fb_accountkit_flutter/fb_accountkit_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

18 out of 18 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/fb_accountkit_flutter.dart.

Run flutter format to format lib/fb_accountkit_flutter.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test