-
Notifications
You must be signed in to change notification settings - Fork 0
Session
All configuration is inside of ContribSentryOptions, but for Session configuration, you have the following options:
-
GlobalSessionMode: I’t recommended to set it as true since the Session is intended to be used by a Client Application and not a server. (Server session hasn’t been fully tested so expect issues)
-
DistinctId: An unique Id of the Client’s device (must be set by the developer if he wishes to track by the DeviceId and not the UserId)
-
sessionEnable (on constructor): Enables the session module, by default, it’s set to true.
var option = new ContribSentryOptions()
{
GlobalSessionMode = true,
DistinctId = "123",
Environment = "prod"
};
For starting a session you simply call ContribSentrySdk.StartSession and for finishing the session you call
ContribSentrySdk.StartSession(user);
or
ContribSentrySdk.StartSession(null);//In case you have set the DistinctId
...
SentrySessionSdk.CloseSession();
For registering the Session when the user closes the app you must call the close function in your Main Activity, inside of OnDestroy
protected override void OnDestroy()
{
ContribSentrySdk.Close();// or ContribSentrySdk.Sleep();
base.OnDestroy();
}