A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14

Last update: Jun 23, 2022

Facebook Sdk For Flutter

GitHub code size GitHub followers GitHub contributors Linkedin LinkedIn GitHub GitHub

facebook_sdk_flutter allows you to fetch deep links, deferred deep links and log facebook app events.

This was created using the latest facebook SDK to include support for iOS 14. The plugin currently supports app events and deeps links for iOS and Android.

Prerequisites

First of all, if you don't have one already, you must first create an app at Facebook developers: https://developers.facebook.com/

Get your app id (referred to as [APP_ID] below)

For IOS

  • If your code does not have CFBundleURLTypes, add the following just before the final element:
 <key>CFBundleURLTypes</key>
    <array>
      <dict>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>fb[APP_ID]</string>
      </array>
      </dict>
    </array>
    <key>FacebookAppID</key>
    <string>[APP_ID]</string>
    <key>FacebookDisplayName</key>
    <string>[DISPLAY_NAME]</string>
    <key>FacebookAutoLogAppEventsEnabled</key>
    <true/>
    <key>FacebookAdvertiserIDCollectionEnabled</key>
    <true/>

For Android

  • Add the following to your strings.xml file

<string name="facebook_app_id">[APP_ID]</string>
<string name="fb_login_protocol_scheme">fb[APP_ID]</string>

  • Add the following meta tag to the application element in AndroidManifest.xml

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

  • Add the following element in AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"/>

  • Don't forget to replace [APP_ID] with your Application ID

GitHub

https://github.com/saadfarhan124/flutter_facebook_sdk
Comments
  • 1. initializeSDK and null check error

    The setAdvertiserTrackingEnabled was throwing a null check error

    In iOS I've got this error "FBSDKLog: FBSDKGraphRequestConnection cannot be started before Facebook SDK initialized", so I need to implement this method "initializeSDK" to work

    Reviewed by EduardoNatale at 2021-10-26 16:45
  • 2. invokeMethod("setAdvertiserTracking"... can return nil

    When calling setAdvertiserTracking, it can return nil according to this line: https://github.com/saadfarhan124/flutter_facebook_sdk/blob/master/ios/Classes/SwiftFlutterFacebookSdkPlugin.swift#L277

    However, on the dart side, the code expect a boolean: https://github.com/saadfarhan124/flutter_facebook_sdk/blob/master/lib/flutter_facebook_sdk.dart#L198

    Reviewed by hermanccw at 2021-07-05 05:03
  • 3. CocoaPods could not find compatible versions for pod "FBSDKCoreKit"

    [!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit": In Podfile: flutter_facebook_auth (from .symlinks/plugins/flutter_facebook_auth/ios) was resolved to 4.3.0, which depends on FBSDKCoreKit (~> 13)

    flutter_facebook_sdk (from `.symlinks/plugins/flutter_facebook_sdk/ios`) was resolved to 0.0.1, which depends on
      FBSDKCoreKit (~> 9.1.0)
    
    Reviewed by MuraliThangavel at 2022-05-11 09:38
  • 4. Ran into error Execution failed for task ':flutter_facebook_sdk:compileDebugKotlin'. with Flutter 3

    I upgraded to Flutter 3.0.1 and Kotlin version 1.6.10 and then started running into this error. Full log below:

    
    e: /Users/justmegawatt/Utils/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_sdk-1.0.0/android/src/main/kotlin/saad/farhan/flutter_facebook_sdk/FlutterFacebookSdkPlugin.kt: (31, 1): Class 'FlutterFacebookSdkPlugin' is not abstract and does not implement abstract member public abstract fun onNewIntent(p0: Intent): Boolean defined in io.flutter.plugin.common.PluginRegistry.NewIntentListener
    e: /Users/justmegawatt/Utils/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_sdk-1.0.0/android/src/main/kotlin/saad/farhan/flutter_facebook_sdk/FlutterFacebookSdkPlugin.kt: (258, 5): 'onNewIntent' overrides nothing
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':flutter_facebook_sdk:compileDebugKotlin'.
    > Compilation error. See log for more details
    
    
    Reviewed by justmegawatt at 2022-05-21 11:29
  • 5. remove init value from deepLinkUrl

    when i call await facebookDeepLinks.getDeepLinkUrl i get Saad Farhan so you need to remove this value

    https://github.com/saadfarhan124/flutter_facebook_sdk/blob/ac89bc0d30d088297a3970f52ee31b8263f313a8/android/src/main/kotlin/saad/farhan/flutter_facebook_sdk/FlutterFacebookSdkPlugin.kt#L43

    Reviewed by abdoosaed at 2022-02-17 18:29
  • 6. Issu in setAdvertiserTracking

    Hi everyone,

    When I call the function setAdvertiserTracking. This function throw the bellow exception "Unhandled Exception: type 'Null' is not a subtype of type 'bool'".

    Regards, Daniel

    Reviewed by dangabdolfo at 2021-11-24 12:35

Related

Facebook based-app - A Facebook based app which actually looks like Facebook
Facebook based-app - A Facebook based  app which actually looks like Facebook

Facebook based mobile application This project is a mobile application which act

Jan 29, 2022
Flutter Plugin for Facebook App Events

facebook_app_events Flutter plugin for Facebook App Events. An app event is an action that takes place in your app or on your web page such as a perso

Jun 8, 2022
Apr 25, 2022
An updated version of flutter_kid_starter from - quangrau using the latest Flutter 3.0 SDK
An updated version of flutter_kid_starter from - quangrau using the latest Flutter 3.0 SDK

This application is an updated version of flutter_kid_starter from - quangrau using the latest Flutter 3.0 SDK, to update this awesome open-source application.

May 25, 2022
Flutter plugin which helps you to find links in String using NSDataDetector and Linkify
Flutter plugin which helps you to find links in String using NSDataDetector and Linkify

Flutter's Native Linkify native_linkify is a Flutter plugin. Use it to find links in plain-text. The plugin uses NSDataDetector for iOS and macOS; Lin

Feb 15, 2022
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

image_editor The version of readme pub and github may be inconsistent, please refer to github. Use native(objc,kotlin) code to handle image data, it i

Jun 14, 2022
A simple project demonstrating how to build a face filter app using Flutter and Deep AR
A simple project demonstrating how to build a face filter app using Flutter and Deep AR

flutter_deepar This is a simple project that will help you learn how to build a simple face filter app with Flutter and Deep AR You can read an articl

May 20, 2022
A flutter plugin to get android version(SDK INT).

get_sdk_int A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that i

Dec 28, 2021
A simple project that will help you learn how to build a simple face filter app with Flutter and Deep AR
A simple project that will help you learn how to build a simple face filter app with Flutter and Deep AR

flutter_deepar This is a simple project that will help you learn how to build a simple face filter app with Flutter and Deep AR You can read an articl

Mar 11, 2022
The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files.

ArDrive Web The ArDrive Web App allows a user to log in to securely view, upload and manage their ArDrive files. Have any questions? Join the ArDrive

Jun 12, 2022
How login , register and log out Firebase Textformfield with focusNode. InheritedWidget example.
How login , register and log out Firebase Textformfield with focusNode. InheritedWidget example.

flutter_fire_base_register How login, register and log out Firebase. Textformfield with focusNode InheritedWidget exam. Stream provider usage. App Hom

May 8, 2021
Pneumonia detection android app based on deep learning API

pneumonia A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Nov 7, 2021
Deep Dive Into Flutter
Deep Dive Into Flutter

Deep Dive Into Flutter This my more formalized version of a Rosetta Stone of Flutter Demos to encourage you to take a deep dive into flutter to master

Apr 28, 2022
A simple log catch server powered by flutter.

flutter_logcat A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Jan 9, 2022
A visualized dynamic programming for log collection based on flutter.

A visualized dynamic programming for log collection based on flutter. Pub使用 1. Depend on it Add this to your package's pubspec.yaml dependencies: mag

May 16, 2022
All four are used to log into a Firebase backend.
All four are used to log into a Firebase backend.

Auth This library package works with four plugins: firebase_auth google_sign_in flutter_facebook_login flutter_twitter All four are used to log into a

Sep 17, 2021
Stories like in Instagram, each story can include multiple images and videos. Package supports video, titles, preliminary caching.
Stories like in Instagram, each story can include multiple images and videos. Package supports video, titles, preliminary caching.

flutter_instagram_stories A Flutter package for displaying stories just like Whatsapp & Instagram. Built-in groups (multiple stories with one icon), c

Jun 15, 2022
GetX Architecture for large scale project, This project include - pagination, pull to refresh, localization, network call and advance error handling

GetX Architecture for large scale project, This project include - pagination, pull to refresh, localization, network call and advance error handling

Jun 10, 2022