Edit in GitHubLog an issue

SDK Events

Description#

When initializing the SDK, an optional OnDeviceDecisioningReady delegate can be provided on the TargetClientConfig object, which will be invoked when the SDK is ready for on-device method calls. There are also a couple other delegates available for handling the on-device decisioning artifact download.

Events#

The following delegates can be configured for certain events:

NameArgumentsDescription
OnDeviceDecisioningReadyNoneCalled only once the first time the client is ready for on-device decisioning
ArtifactDownloadSucceededstring contents of artifact fileCalled every time an on-device decisioning artifact is downloaded
ArtifactDownloadFailedExceptionCalled every time there is a failure to download an on-device decisioning artifact

Example#

Copied to your clipboard
1var clientConfig = new TargetClientConfig.Builder("acmeclient", "1234567890@AdobeOrg")
2 .SetDecisioningMethod(DecisioningMethod.OnDevice)
3 .SetOnDeviceDecisioningReady(DecisioningReady)
4 .SetArtifactDownloadSucceeded(artifact => Console.WriteLine("The artifact was successfully downloaded. Contents: " + artifact))
5 .SetArtifactDownloadFailed(exception => Console.WriteLine("The artifact failed to download. Exception: " + exception.Message))
6 .Build();
7
8var targetClient = TargetClient.Create(clientConfig);
9
10// ...
11
12static void DecisioningReady()
13{
14 var mboxRequests = new List<MboxRequest> { new (index: 1, name: "a1-serverside-ab") };
15
16 var targetDeliveryRequest = new TargetDeliveryRequest.Builder()
17 .SetExecute(new ExecuteRequest(mboxes: mboxRequests))
18 .Build();
19
20 var targetResponse = targetClient.GetOffers(targetDeliveryRequest);
21}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.