17

I would like to add the Facebook app-events to my Flutter project : https://developers.facebook.com/docs/app-events/android https://developers.facebook.com/docs/app-events/ios

It relies on the Facebook SDK. However, it seems that there is no available plugin for the Facebook SDK integration in Flutter.

May I know should Flutter users implement their plugin to use the Facebook features?

Thanks!

Dennis Alund
  • 2,916
  • 1
  • 13
  • 34
h19881103
  • 373
  • 2
  • 3
  • 9
  • Maybe this can help: https://pub.dartlang.org/packages/flutter_facebook_login and https://pub.dartlang.org/packages/firebase_auth – Andrii Turkovskyi Oct 23 '18 at 06:11
  • Hi Andrey, many thanks for the references. I've used these plugins as well in my projects. They work fine. However, the facebook product app-events requires the information which cannot be provided in flutter app.(e.g. application context). I have no way to migrate this product from my original Android application to the new Flutter application. – h19881103 Oct 23 '18 at 06:23
  • Oh, I understand. I didn't use FB in flutter yet. I think, in this case only way is to add FB SDK for android and work through FlutterActivity – Andrii Turkovskyi Oct 23 '18 at 06:34
  • 1
    Hi Andrey and all, thanks for replying. I've prepared a flutter plugin which integrates the FB SDK. However, I find that this Facebook product(app-events) supports only to track the events in native Android/iOS structure(e.g. use android activities as input for the event logging). In my flutter project, most of my widgets are under lib folder. there is no android activities. I think I am not able to proceed even I can call the APIs in Facebook SDK. – h19881103 Oct 24 '18 at 01:21
  • Don't you have "android" and "ios" folder on the same level as "lib"? – Andrii Turkovskyi Oct 24 '18 at 06:22
  • 2
    @h19881103 Did you figure out how to do this? I want to be able to use FaceBook app events (https://developers.facebook.com/docs/app-events) in my flutter app, without using FaceBook login, in order to track the effects of marketing campaigns. Any updates on this would be highly appreciated! – jonasjuss May 30 '19 at 11:43
  • Did you manage to get the app installs from facebook ads campaign? I am not able to get any app engagement data – Amit Kabra Mar 16 '21 at 13:55
  • Why don't you try this pub instead of writing native code: https://pub.dev/packages/flutter_facebook_sdk/example – Donat Kabashi Feb 08 '22 at 07:57
  • @AmitKabra Did you get any change to get analytics of app installation from Facebook ads Campaign? We're looking into same direction for one of our app. – Purvik Rana Mar 10 '22 at 10:11

1 Answers1

21

At the time of answering this, there is currently no official plugin or package from the Facebook team.

But I had the same needs as you, so I wrote and published a plugin: facebook_app_events

It supports codeless app events as well as implements most of the App Events SDK.

Hope that answers your question and needs.

Dennis Alund
  • 2,916
  • 1
  • 13
  • 34
  • 1
    Thanks for sharing! It's really useful and i would say basic for any app to be marketed on FB to include fb events – voytez Nov 22 '19 at 17:47
  • @Dennis Alund, I've created my app this week on facebook and I'm not getting analytics data. Do you think it has to do with the "pause of individual verification"? https://developers.facebook.com/blog/post/2020/03/24/pausing-individual-verification/ – Daniel Apr 05 '20 at 13:53
  • Hm, not sure how the facebook analytics work. But for Firebase it can take up to 24hrs before we see the data after adding SDK. – Dennis Alund Apr 06 '20 at 03:57
  • @DennisAlund how have you done it? It doesn't work for me, I can see my phone but not clicking in any button to link an event – Ricardo Romero Benítez Jul 17 '20 at 13:24
  • Did you manage to get it work Ricardo? Happy to get a detailed bug report if you have are experiencing any issues or if you think that the documentation could be improved. – Dennis Alund Oct 15 '20 at 06:01
  • Does this package support automatic logging for the 'app install' kind of events? – user3473445 Nov 01 '20 at 21:21
  • Yes, I actually think you get the app install events automatically if you're using any part of the Facebook SDK. But definitely, for this plugin you do get it. – Dennis Alund Nov 04 '20 at 02:20
  • @DennisAlund unfortunately not, it doesn't track the standard events – Ricardo Romero Benítez Mar 02 '21 at 22:14
  • Hi, am always getting "Error registering plugin facebook_app_events, id.oddbit.flutter.facebook_app_events.FacebookAppEventsPlugin The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first." this error wher using the library – arjunkn Dec 03 '21 at 08:57
  • Hi there, @arjunkn sounds like a question to be opened by itself. Please post a question with full code context and as much information as possible and I'll try to help. – Dennis Alund Dec 03 '21 at 08:59
  • @DennisAlund My mistake it's ok now, Good work. – arjunkn Dec 03 '21 at 09:32
  • Happy you got it working! If you found something missing in the setup instructions, feel free to start a discussion on the repo:https://github.com/oddbit/flutter_facebook_app_events/discussions – Dennis Alund Dec 05 '21 at 07:32