facebook-login
facebook-login copied to clipboard
App Events Facebook
Is your feature request related to a problem? Please describe. I want to implement App Events Facebook on my Ionic Capacitor project and use Facebook Login.
Describe the solution you'd like I want to have a function like this library : https://ionicframework.com/docs/native/facebook
.logEvent(MY_EVENT);
Describe alternatives you've considered
-
I have check to use this plugin : https://github.com/SpellChucker/capacitor-plugin-facebook-analytics But it's not work on Capacitor 4
-
I use this plugin https://ionicframework.com/docs/native/facebook but i think it's very complicated to use cordova plugin on Capacitor projet :( For now, my build doesn't work
Thanks ! 🙏
Seems pretty straightforward to implement. Just add a method .logEvent(MY_EVENT);
https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#manually-log-events https://developers.facebook.com/docs/app-events/getting-started-app-events-android#log-manually
I am not sure if my app is configured properly because the only Test Events that I receive are
fb_login_dialog_confirm_accept
fb_login_dialog_confirm_impression
and I only receive these on iOS. I don't receive any Test Events on android.
(I can't log events using facebookConnectPlugin.logEvent(String name, Object params, Number valueToSum, Function success, Function failure)
https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect#log-an-event either so I believe this is a problem with my app).
@cprodhomme perhaps you can give it a try and see if it works for you.
Here is how you can test
git clone https://github.com/codeconsole/facebook-login
cd facebook-login
git checkout app-events
then update your app/package.json
to your app to point to the plugin directory:
"@capacitor-community/facebook-login": "file:../facebook-login",
My directory structure is:
app
facebook-login
Syntax is:
Capacitor.Plugins.FacebookLogin.logEvent({eventName:'BattleTheMonster'})
https://github.com/capacitor-community/facebook-login/pull/112
Seems related to my issue https://github.com/SpellChucker/capacitor-plugin-facebook-analytics/issues/4
I have determined on iOS, it is version specific. v13.5 works but 15.2 does not work.
Not sure if the following are related: https://developers.facebook.com/docs/audience-network/setting-up/platform-setup/ios/add-sdk/ https://stackoverflow.com/questions/68599825/not-receiving-events-via-facebook-ios-sdk https://developers.facebook.com/docs/app-events/guides/advertising-tracking-enabled/ https://stackoverflow.com/questions/67832203/cannot-find-fbadsettings-isadvertisertrackingenabledtrue https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#add-events
I just confirmed Capacitor.Plugins.FacebookLogin.logEvent({eventName:'BattleTheMonster'})
also works with iOS 13.7 devices.
https://github.com/facebook/facebook-ios-sdk/issues/1937
https://github.com/xamarin/FacebookComponents/issues/228
I confirm Android works. The only issue is iOS 14+
https://github.com/facebook/facebook-ios-sdk/issues/2145
iOS 14+ works ask long as Allow Tracking
is turned on inside the Facebook App of the user signing in regardless of whether or not the Facebook App is installed on the same device running the app.
Would be amazing if u could add it to the package, I was trying to use https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect on my capacitor project without success, I'm unable to build the app
But It would be nice if you could add logEvent
, setUserData
and clearUserData
@FernetB for logEvent
, you can just use my repository for the time being until it is merged.
To use my version instead, just do:
nom install https://github.com/codeconsole/facebook-login#app-events
Looking at the FB developer documentation, I am not seeing anything on setUserData
or clearUserData
.
Are those associated with analytics? That was shut off by FB.
https://www.facebook.com/business/help/966883707418907 https://developers.facebook.com/docs/reference/android/current/class/AppEventsLogger/
Hey, thanks for the fast response!
I saw that from here https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect#advanced-matching and here https://developers.facebook.com/docs/app-events/advanced-matching/
@FernetB
I think it was removed from the API because if you see here
https://developers.facebook.com/docs/app-events/advanced-matching/
It shows setUserData
is a method of AppEventsLogger
, but the links to the documentation for AppEventsLogger
are broken.
And of you view the latest documentation
https://developers.facebook.com/docs/reference/android/current/class/AppEventsLogger/
there is no setUserData
method
@codeconsole do you have idea if automatic app install events will be tracked ? Just wonder if we can use this for it...
Is it possible to user the plugin to trace app installations and other events? are there any limitations on ios or android?
same question. can i use this plugin for tracking app installs ?
Please add a second parameter in LogEvent function like this:
logEvent(options: { name: string, params: any })
so we can use it to log all events related to facebook ads
@trinitiwowka @marshall86 You can use this freshly new plugin that is compatible with Capacitor 5 https://www.npmjs.com/package/capacitor-facebook-events