adjust-icon

Send callback information

Configure callbacks to call functions when the SDK sends information to Adjust. You can configure callbacks for sessions and events.

Session callbacks

Configure session callbacks to call functions when the SDK sends session information. You can configure success callbacks and failure callbacks. Success callbacks are called when the SDK sends information to Adjust's servers. Failure callbacks are called 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.

PropertyTypeDescription
messagestd::stringThe message from the server or the error logged by the SDK.
timestampstd::stringThe timestamp from Adjust's servers.
adidstd::stringA unique device identifier provided by Adjust.
jsonResponsestd::stringThe JSON object with the response from the server.
willRetryboolIndicates whether there will be an attempt to resend a failed package. Available only on failure callbacks.

Success callbacks

Configure a success callback to call a function when the SDK records a session.

std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel2dxVerbose);
adjustConfig.setSessionSuccessCallback([](AdjustSessionSuccess2dx adjustSessionSuccess) {
// process adjustSessionSuccess
});
Adjust2dx::initSdk(adjustConfig);

Failure callbacks

Configure a failure callback to call a function when the SDK fails to record a session.

std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel2dxVerbose);
adjustConfig.setSessionFailureCallback([](AdjustSessionFailure2dx adjustSessionFailure) {
// process adjustSessionFailure
});
Adjust2dx::initSdk(adjustConfig);

Event callbacks

Configure event callbacks to call a function when the SDK sends event information. You can configure success callbacks and failure callbacks. Success callbacks are called when the SDK sends information to Adjust's servers. Failure callbacks are called 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.

PropertyTypeDescription
messagestd::stringThe message from the server or the error logged by the SDK.
timestampstd::stringThe timestamp from Adjust's servers.
adidstd::stringA unique device identifier provided by Adjust.
eventTokenstd::stringThe event token
callbackIdstd::stringThe custom callback ID set on the event object
jsonResponsestd::stringThe JSON object with the response from the server.
willRetryboolIndicates whether there will be an attempt to resend a failed package. Only available on failure callbacks.

Success callbacks

Configure a success callback to call a function when the SDK records an event.

std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel2dxVerbose);
adjustConfig.setEventSuccessCallback([](AdjustEventSuccess2dx adjustEventSuccess) {
// process adjustEventSuccess
});
Adjust2dx::initSdk(adjustConfig);

Failure callbacks

Configure a failure callback to call a function when the SDK fails to record an event.

std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel2dxVerbose);
adjustConfig.setEventFailureCallback([](AdjustEventFailure2dx adjustEventFailure) {
// process adjustEventFailure
});
Adjust2dx::initSdk(adjustConfig);