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.Payload: Additional payload data associated with the trigger, exposed as a JSON string.
Configure the remote trigger callback
To configure your callback function, assign a function to the RemoteTriggerDelegate property on your AdjustConfig instance.
public Action<AdjustRemoteTrigger> RemoteTriggerDelegate { get; set; }This example shows how to register a remote trigger callback that logs the trigger label and payload.
using AdjustSdk;
public class ExampleGUI : MonoBehaviour { void OnGUI() { if (GUI.Button(new Rect(0, 0, Screen.width, Screen.height), "callback")) { AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox); adjustConfig.LogLevel = AdjustLogLevel.Verbose; adjustConfig.RemoteTriggerDelegate = RemoteTriggerCallback; Adjust.InitSdk(adjustConfig); } }
public void RemoteTriggerCallback(AdjustRemoteTrigger remoteTrigger) { Debug.Log("Remote trigger callback called!"); Debug.Log("Remote trigger label: " + remoteTrigger.Label); Debug.Log("Remote trigger payload: " + remoteTrigger.Payload); }}