iosobjective-cfacebookcachingfacebook-events

Is Facebook Caching FBAppEvents


I'm trying to integrate FBAppEvents. I've already created my app and all I need to do now is call FBAppEvents logEvent: However, I want to know if I need to cache my Events just in case logging wasn't successful due to sudden connection loss or something. If I'm caching them, my app could resend the events.

If FB is caching events and handling failed events on their own, then that would be awesome. If not, then I would need to create my own event caching. Sadly, I couldn't find callback methods to inform me that events were successfully logged or not. Is there a way I could do to achieve what I want?


Solution

  • From the FBAppEvents documentation page: https://developers.facebook.com/docs/reference/ios/current/class/FBAppEvents

    Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers in a number of situations: when an event count threshold is passed (currently 100 logged events). when a time threshold is passed (currently 15 seconds). when an app has gone to background and is then brought back to the foreground.

    Events will be accumulated when the app is in a disconnected state, and sent when the connection is restored and one of the above 'flush' conditions are met.