Click or drag to resize
KomfoProviderDeleteCustomAudienceAsync Method
Deletes the custom audience asynchronously.

Namespace: KomfoSharp.Provider
Assembly: KomfoSharp (in KomfoSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public Task<CustomAudience> DeleteCustomAudienceAsync(
	string accessToken,
	string customAudienceId
)

Parameters

accessToken
Type: SystemString
The access token.
customAudienceId
Type: SystemString
The custom audience identifier.

Return Value

Type: TaskCustomAudience
The custom audience which was removed.

Implements

IKomfoProviderDeleteCustomAudienceAsync(String, String)
Examples
try
{
  var customAudience = await komfoProvider.DeleteCustomAudienceAsync("<your_access_token>", customAudienceId);
  this.ShowCustomAudience(customAudience);
}
catch (KomfoProviderException ex)
{
  if (ex.KomfoStatusCode == KomfoStatusCode.AudienceIdIsNotValidCustomAudience)
  {
    Console.WriteLine("The custom audience doesn't exist.");
  }

  if (ex.KomfoStatusCode == KomfoStatusCode.CustomAudienceParticipateInActiveAdvertisements)
  {
    Console.WriteLine("Cannot delete the custom audience. The custom audience is participating in active advertisements.");
  }
}
See Also