The Adjust SDK can listen for remote triggers configured in Adjust and notify your app when a trigger is received. You can use this functionality to react to server-side configured activities and access the trigger metadata within your application.
Remote trigger object
The SDK invokes the callback function whenever a configured remote trigger is received.
The callback provides an AdjustRemoteTrigger object containing information about the trigger, including:
label: The trigger label configured in Adjust.payloadJson: Additional payload data associated with the trigger, exposed as a JSON string.
Configure the remote trigger callback
To configure your callback function, assign your function to the remoteTriggerCallback property on your config instance.
typedef void RemoteTriggerCallback(AdjustRemoteTrigger remoteTrigger);RemoteTriggerCallback? remoteTriggerCallback;This example shows how to assign a remote trigger callback that logs the trigger label and payloadJson.
AdjustConfig adjustConfig = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
adjustConfig.remoteTriggerCallback = (AdjustRemoteTrigger remoteTrigger) { print('Received remote trigger!'); print('Remote trigger label: ${remoteTrigger.label}'); print('Remote trigger payload JSON: ${remoteTrigger.payloadJson}');};
Adjust.initSdk(adjustConfig);