xamarin / FacebookComponents

MIT License
88 stars 70 forks source link

Xamarin.Facebook.iOS (9.0.1.5) - Not logging events #217

Open tigreye007 opened 3 years ago

tigreye007 commented 3 years ago

No events are logged, including events that should be automatically logged according to Facebook.

We have verified that the FacebookAppID, FacebookClientToken, FacebookDisplayName and LSApplicationQueriesSchemes are set correctly in the Info.plist. We also use the Facebook Login functionality, which has been working great, so that tells me that all pre-existing configuration was also correct before we implemented Event logging.

We have implemented the recommended Tracking Manager code (per Apple) as follows in our main controller. We receive the confirmation dialog, and have verified these settings are all set to true when the user agrees.

        ATTrackingManager.RequestTrackingAuthorization((result) =>
        {
            switch (result)
            {
                case ATTrackingManagerAuthorizationStatus.Authorized:
                    Facebook.CoreKit.Settings.AdvertiserTrackingEnabled = true;
                    Facebook.CoreKit.Settings.AutoLogAppEventsEnabled = true;
                    Facebook.CoreKit.Settings.AdvertiserIdCollectionEnabled = true;
                    break;
                default:
                    Facebook.CoreKit.Settings.AdvertiserTrackingEnabled = false;
                    Facebook.CoreKit.Settings.AutoLogAppEventsEnabled = false;
                    Facebook.CoreKit.Settings.AdvertiserIdCollectionEnabled = false;
                    break;
            }
        });

Here is a sample of an event that we are attempting to log. The code doesn't error out, and appears to succeed, however (even after several days) we do not see this event in the Facebook Events Manager:

var parms = new Dictionary<string, string>(); parms.Add("FBSDKAppEventParameterNameCurrency", "USD"); parms.Add("valueToSum", "0"); Facebook.CoreKit.AppEvents.LogEvent(Facebook.CoreKit.AppEventName.StartTrial, NSDictionary.FromObjectsAndKeys(parms.Values.ToArray(), parms.Keys.ToArray()));

There are no messages logged (that we can find) to the device suggesting that anything failed. We use the same AppID, etc for Android, and have no issues on that platform - events are logged as expected. It is entirely possible that we've missed something in the implementation, however we've been using this ID for Facebook Login as well without issue.

I have tested this on both an iPhone 12 Pro / iOS 15 simulator and a full release build on TestFlight with an iPhone 11 // iOS 15.

thisisthekap commented 2 years ago

Might be related to #223

thisisthekap commented 2 years ago

This comment might explain the issue: https://github.com/xamarin/FacebookComponents/issues/223#issuecomment-985288732

MateuszLas421 commented 2 years ago

I have the same problem