We constantly publish updates to our documentation, which may not yet be available in your language. For the most current information, use the English version.
Set up session callbacks to trigger functions when the SDK sends session information. You can create success callbacks and failure callbacks. Success callbacks trigger when the SDK sends information to the Adjust backend. Failure callbacks trigger when the SDK encounters a problem while sending the information.
Session callbacks have access to a response data object. You can use its properties in your callback function.
Session data object
Property
Data type
Description
Message
String
The message from the server or the error logged by the SDK.
Timestamp
String
The timestamp from the Adjust backend.
Adid
String
A unique device identifier provided by Adjust.
jsonResponse
Dictionary <string, object>
The JSON object with the response from the server.
WillRetry
Boolean
Returned if the session object failed. Indicates whether there will be an attempt to resend the package at a later time.
In this example, we set up a callback function sessionSuccess and register it as a success callback. The function logs the timestamp at which the SDK measured the session.
Set up event callbacks to trigger functions when the SDK sends event information. You can create success callbacks and failure callbacks. Success callbacks trigger when the SDK sends information to the Adjust backend. Failure callbacks trigger when the SDK encounters a problem while sending the information.
Event callbacks have access to a response data object. You can use its properties in your callback function.
Event data object
Property
Data type
Description
Message
String
The message from the server or the error logged by the SDK.
Timestamp
String
The timestamp from the Adjust backend.
Adid
String
A unique device identifier provided by Adjust.
JsonResponse
Dictionary <string, object>
The JSON object with the response from the server.
EventToken
String
The event token.
CallbackId
String
The custom defined callback ID set on event object.
WillRetry
Boolean
Returned if the event object failed. Indicates whether there will be an attempt to resend the package at a later time.
In this example, we set up a callback function eventSuccess and register it as a success callback. The function logs the timestamp at which the SDK measured the event.