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, call the setRemoteTriggerCallback method with your function as an argument.
public setRemoteTriggerCallback(callback: (remoteTrigger: AdjustRemoteTrigger) => void): voidThis example shows how to register a remote trigger callback that logs the trigger label and payloadJson.
const adjustConfig = new AdjustConfig( "{YourAppToken}", AdjustConfig.EnvironmentSandbox,);
adjustConfig.setRemoteTriggerCallback(function (remoteTrigger) { console.log("Remote trigger callback called!"); console.log("Remote trigger label: " + remoteTrigger.label); console.log("Remote trigger payload: " + remoteTrigger.payloadJson);});
Adjust.initSdk(adjustConfig);