flutter_facebook_appevents 0.1.1+3

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

flutter_facebook_appevents #

2019 © Weizhong Yang.

pub package Actions Status

The package bridges Facebook App Events feature to your Flutter app.

It helps you to install Facebook SDK 5.x for iOS and Android, and makes your app to start sending events to Facebook automatically once you complete the configuration for your app. You can track additional events with the package, if you want to.

Installation #

Add the following line to your pubspec.yaml file

    git: "git@gitlab.kkinternal.com:xddd/flutter_facebook_appevents.git"

The call flutter packages get.

Configuration #

You need add additional configuration to your app in order to integrate Facebook SDK on both iOS and Android platform.

iOS #

Please add following lines to your Info.plist file:


Your Facebook app ID and display name are required. On the other hand, you can decide to enable auto-log app events and collecting advertiser ID or not by your self.

Android #

Please add the following lines to the application scope in your AndroidManifest.xml file:

    android:value="@string/facebook_app_id" />
    android:value="true" />
    android:value="true" />
    android:value="false" />

Then add create a file strings.xml under app->src->main->res->values, and add following lines:

<?xml version="1.0" encoding="utf-8"?>
    <string name="facebook_app_id">[YOUR_FB_APP_ID]</string>
    <string name="fb_login_protocol_scheme">fb[YOUR_FB_APP_ID]</string>

Manual Events #

You can track additional events using the package as well. To track a manual event, just call FacebookAppEvents.logEvent(). For example

FacebookAppEvents.logEvent("EVENT_NAME", {"PARAMETER_NAME": "VALUE"}))

You can take a look at the classes like EventName and ParameterName to find the events and parameters that Facebook supports.

Notes #

I wrote the package merely for my own need, because I could not find any package for Facebook App Events in June, 2019. However, I found there are various great packages for the same purpose when I published the package. You may want to take a look on the packages:

0.1.1+3 #

  • Updates dependencies.

0.1.1+2 #

  • Upgrades Facebook SDK for Android.

0.1.0+1 #

  • Initial release.


import 'package:flutter/material.dart';
import 'package:flutter_facebook_appevents/flutter_facebook_appevents.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  void initState() {

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
                  child: Text("Reset User ID"),
                  onPressed: () => FacebookAppEvents.resetUserId()),
                  child: Text("Set User ID"),
                  onPressed: () => FacebookAppEvents.setUserId("user")),
                  child: Text("Log Event"),
                  onPressed: () =>
                      FacebookAppEvents.logEvent("test_", {"k": "v"})),

Use this package as a library

1. Depend on it

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

  flutter_facebook_appevents: ^0.1.1+3

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:flutter_facebook_appevents/flutter_facebook_appevents.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8


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.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
pedantic ^1.8.0