Skip to content
LucasZF edited this page Oct 1, 2020 · 6 revisions

Launched: V3.1.0

When enabled in ContribSentryOptions, the SDK will always try to cache your Session and Tracing Data and release those when they are sent to Sentry.

Event Caching

For Caching events, you must inform a Func function to ContribSentryOptions in HasInternet, if not set, ContribSentry will never cache SentryEvents. HasInternet is a simple call to check if your application has internet or not, if there's internet, ContribSentry will not cache it, otherwise, the SDK will cache and consume the SentryEvent.

Directory

In order for the Caching system to work, you must inform the Path in ContribSentryOptions.CacheDirPath, if not, the Cache service will be disabled.

Max Cached Ammount

By default, you can store 100 Transactions or Sessions + 100 SentryEvents, to change this number, simply alter the Options.CacheDirSize value.

Xamarin.Forms/Android/Ios

It's recommended to set CacheDirPath with Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Sentry")

Sleep/Resume (new in 3.1.4)

When your app moves to the background or your app closes, ContribSentry might lose information, to avoid that, simply call ContribSentrySdk.Sleep when your app is moving to background or is closing, and ContribSentrySdk.Resume when your app goes back to foreground.

On a Xamarin forms application, you can place those functions at App.xaml.cs inside of OnResume and OnSleep.

Clone this wiki locally