---
updatedAt: 2026-09-04T07:13:15.000Z
agentTools:
  projectIndex: https://documentation.indigitall.com/llms.txt
---

# Advance Settings

## Retargeting

Your app can send information to indigitall's servers to identify the actions and events that happen in it. This allows you to automate **retargeting** actions.

To register these events you have to call the **sendCustomEvent** method, passing a descriptive ID as a parameter (you can invent the one you like best) and set data you need.

The data must be added in an array of the INHashMap model like the one in the example indicated below.

```csharp
Com.Indigitall.Maui.Push.Models.INDMHashMap[] iNHashMap = new Com.Indigitall.Maui.Push.Models.INDMHashMap[2];
iNHashMap[0] = new Com.Indigitall.Maui.Push.Models.INDMHashMap("key1", "value1");
iNHashMap[1] = new Com.Indigitall.Maui.Push.Models.INDMHashMap("key2", "value2");

indigitall.SendCustomEvent("YOUR_CUSTOM_EVENT", "eventId_optional", "eventAt_optional", iNHashMap, () =>
{
    // Do something in success function
}, (ErrorDescription) =>
{
    //ERROR DO SOMETHING
});
```

## Topics

Our SDK allows you to classify users into different customizable groups. This is very useful for:

* Implement a preferences screen so that the user can choose the topics for which they want to receive notifications.
* Label according to the navigation or actions that the user performs.
* Segment communications according to whether the user has identified or is anonymous.
* Segment based on language, culture, customer category, or based on any other criteria you need.

Remember that you must first define the groups you want to work with in the indigitall console ([Tools> Topics](https://console.indigitall.com/tools/topics)).

\***List Groups**

Use the **topicsList** method to get the list of groups that are configured in your indigitall project. The callback of this method receives as a parameter an array of Topics, which contains the information of all the available groups, as well as a flag that indicates whether the user is included in any of them.

```csharp
indigitall.TopicsList((topic) =>
  {
      //DO SOMETHING
  }, (errorCode, messageError) =>
  {
      //Log error
  });
```

\***Manage subscription**

To manage the device subscription to one or more groups, there are two methods: **topicsSubscribe** and **topicsUnsubscribe**.

Optionally, both receive a TopicsCallback object as the third parameter, which will return the list of all Topic in the project.

```csharp
//topics typeof string[]
  indigitall.TopicsSubscribe(topics, (topic) =>
  {
      //DO SOMETHING
  }, (errorCode, messageError) =>
  {
      //Log error
  });

  indigitall.TopicsUnsubscribe(topics }, (topic) =>
  {
     //DO SOMETHING
  }, (errorCode, messageError) =>
  {
      //Log error
  });
```

## Collection of push data

In the event that you want to obtain the push object of type json to perform checks and / or when the user clicks on the notification and it is with the action of open app, we leave you this code that will help to obtain it:

<HTMLBlock>{`
<div class="wifi_subtitle">Android</div>

<style>
  .wifi_subtitle {
    font-size:16px;
    font-weight: bold;
  }
</style>
`}</HTMLBlock>

* **Set the default Activity**\
  The Activity by default is the initial screen of your app that is launched when a user clicks on a notification that does not have a deeplink. It is also the point where you should initialize the SDK. It is set by the parameter **DefaultActivity**:

```csharp
//When you want to start indigitall
  Com.Indigitall.Android.Indigitall.SetDefaultActivity(this, Java.Lang.Class.FromType(typeof("YOUR_ACTIVITY")).Name);

  //or also
  Com.Indigitall.Maui.MPushConfiguration config = new ();
  config.AppKey = "<YOUR-APP-KEY>";
  config.SenderId = "<YOUR-SENDER-ID>";
  config.DefaultActivity = Java.Lang.Class.FromType(typeof(MainActivity)).Name;
  indigitall.Init(config)
```

In the case of **Android** we must add this code in the MainActivity and parse it as a push object to obtain the information:

```csharp
var pushExtra = Com.Indigitall.Android.Models.Push.ExtraPush;
    if (Intent != null && Intent.GetStringExtra(pushExtra) != null)
    {
        Com.Indigitall.Android.Models.Push push = new Com.Indigitall.Android.Models.Push(Intent.GetStringExtra(pushExtra));
        Console.WriteLine("Push object: ", push);
    }
```

If you decide to treat the Push action independently without going through our SDK, in order to record the statistics you must do the following depending on the platform.

In the case of **Android**, the intent of the action is collected in your activity where the **ServiceUtils.RegisterStatistics** method should be called. For this case, you can, for example, create a class that extends from our PushNotification to generate the intent with the following extras:

```csharp
public class PushNotification : Com.Indigitall.Android.Models.PushNotification
    {
        Push push;
        Context context;

        public PushNotification(Push push): base(push)
        {
            this.push = push;
        }
        public override void ShowNotification(Context context)
        {
            this.context = context;            
            base.ShowNotification(context);           
        }
    protected override PendingIntent GetIntent(PushAction action, int clickedButton){
      Intent intent = action.GetIntent(context);
      Intent indigitallIntent;
      indigitallIntent = new Intent(context, typeof(MainActivity));
      indigitallIntent.SetFlags(ActivityFlags.NewTask);
      indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraAppKey, Com.Indigitall.Android.Commons.Utils.PreferenceUtils.GetAppKey(context));
      indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraPushId, push.Id);
      indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraClickedButton, clickedButton);
      indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraIntentAction, intent);
      indigitallIntent.PutExtra(Push.ExtraPush, push.ToString());
      if (action.GetTopics() != null && action.GetTopics().Length > 0)
      {
          indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraActionTopics, action.TopicsToString());
      }
      TaskStackBuilder stackBuilder = TaskStackBuilder.Create(context);
      stackBuilder.AddNextIntentWithParentStack(indigitallIntent);

      return stackBuilder.GetPendingIntent((push.Id * 10) + clickedButton,
                  PendingIntentFlags.OneShot);  
    }
```

Once the push has been collected, as explained in the previous section, the following method must be called to register statistics:

```csharp
Com.Indigitall.Android.Utils.ServiceUtils.RegisterStatistics(context, indigitallIntent);
```

<HTMLBlock>{`
<div class="wifi_subtitle">iOS</div>

<style>
  .wifi_subtitle {
    font-size:16px;
    font-weight: bold;
  }
</style>
`}</HTMLBlock>

In the case of **iOS** we must add this code in the AppDelegate of the application, both in the **DidReceiveRemoteNotification** method for the main action, and for the **HandleAction** method for the button action:

```csharp
//class extends UNUserNotificationCenterDelegate
[Export("userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:")]
    public override void DidReceiveNotificationResponse(UserNotifications.UNUserNotificationCenter center, UserNotifications.UNNotificationResponse response, Action completionHandler)
    {
        IndigitallMaui.Indigitall.HandleWithResponse(response, (push, action) =>
        {
            Console.WriteLine("DidReceiveNotificationResponse push: " + push);
            Console.WriteLine("DidReceiveNotificationResponse action: " + action.App);
        });
    }

//DidReceiveRemoteNotification
Com.Indigitall.Maui.Platforms.iOS.MIndigitall.HandleActionPush(userInfo, null, (push, action) => {
                Console.WriteLine("DidReceiveRemoteNotification push: " + push);
                Console.WriteLine("DidReceiveRemoteNotification action: " + action.app);
            });

//HandleAction
Com.Indigitall.Maui.Platforms.iOS.MIndigitall.HandleActionPush(remoteNotificationInfo, actionIdentifier, (push, action) => {
                Console.WriteLine("HandleAction push: " + push);
                Console.WriteLine("HandleAction action: " + action.app);
            });
```

If you decide to treat the Push action independently without going through our SDK, in order to record the statistics you must do the following depending on the platform.

In the case of **iOS** in the userNotificationCenter: didReceive method of the AppDelegate itself, in order to record the statistics, the following method must be added:

```csharp
IndigitallMaui.Indigitall.RegisterStatistics(response);
```

## Push Secure Received Event - iOS platform

On Android is implemented into native sdk, but on iOS you have to add code.

> 🚧 Only on API use of Push Secure Sending

If you want to receive an event that indicate if the push comes with **sendEventAck** flag and the encrypted *pushes are active*, add the following on AppDelegate on didReceived method:

```swift swif
[Export("application:didReceiveRemoteNotification:fetchCompletionHandler:")]
public void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
{
 Com.Indigitall.Maui.Platforms.iOS.MIndigitall.DidReceivePushWithNotification(userInfo, (push) =>
	{
		 Console.WriteLine("Is push Secure: " + push);
 	});
}
```

<br />

## Custom Push Notification Sounds (.NET MAUI – Android)

In .NET MAUI (Android target), the process is very similar since MAUI apps also use the Android notification system under the hood.

### When to Consider a Custom Sound

A unique sound may help highlight certain notifications, such as:

* Urgent alerts that require immediate attention.
* Differentiating between notification categories (e.g., system vs. promotional).
* Reinforcing a branded experience.

> ⚠️ Custom sounds can sometimes feel intrusive or disruptive for users, especially if they are loud, long, or significantly different from system defaults. In many cases, sticking to the system sound provides a more consistent and user-friendly experience.

### Adding a Custom Sound File

1. Add your audio file (e.g., alert.mp3) to the Resources/Raw/ folder of your MAUI project.

Example path: MyMauiApp/Resources/Raw/alert.mp3

2. Ensure the file is lowercase and free of spaces or special characters.

### Implementing in Code

You can create a NotificationChannel with a custom sound inside your MainActivity.cs:

```csharp
using Android.App;
using Android.Content;
using Android.Media;
using Android.Net;
using Android.OS;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
        {
            var notificationManager = 
                (NotificationManager)GetSystemService(Context.NotificationService);

            var channel = new NotificationChannel(
                "default", 
                "CHANNEL_NAME", 
                NotificationImportance.High
            );

            var soundUri = Uri.Parse($"{ContentResolver.SchemeAndroidResource}://{PackageName}/{Resource.Raw.alert}");

            var audioAttributes = new AudioAttributes.Builder()
                .SetContentType(AudioContentType.Sonification)
                .SetUsage(AudioUsageKind.Notification)
                .Build();

            channel.SetSound(soundUri, audioAttributes);
            notificationManager.CreateNotificationChannel(channel);
        }
    }
}

```

**Important Notes**

* Same considerations as Xamarin.Android apply: once a channel is created, its sound cannot be changed.
* Sound files must be embedded in Resources/Raw/ and kept short.
* Below Android 8.0, custom sounds work but without notification channels.

<br />

## Custom Push Notification Sounds (.NET MAUI – iOS)

In .NET MAUI (iOS target), the process is the same as in Xamarin.iOS because MAUI also relies on a Notification Service Extension for advanced notification handling.

### Adding a Custom Sound File

1. Add your sound file (alert.caf, alert.wav, or alert.aiff) to the root folder of your iOS Notification Service Extension (Platforms/iOS/NotificationServiceExtension/).
2. Make sure its Build Action is set to BundleResource.
3. File names must exactly match what you configure in code.

### Implementing in Code

Inside your NotificationService.cs:

```csharp
using System;
using UserNotifications;

public class NotificationService : UNNotificationServiceExtension
{
    UNNotificationContent bestAttemptContent;
    UNNotificationRequest request;
    Action<UNNotificationContent> contentHandler;

    public override void DidReceiveNotificationRequest(
        UNNotificationRequest request, 
        Action<UNNotificationContent> contentHandler)
    {
        this.contentHandler = contentHandler;
        bestAttemptContent = (UNMutableNotificationContent)request.Content.MutableCopy();

        // Set custom sound
        bestAttemptContent.Sound = UNNotificationSound.GetSound("alert.caf");

        // Create a new request with updated content
        this.request = UNNotificationRequest.FromIdentifier(
            request.Identifier,
            bestAttemptContent,
            request.Trigger
        );

        Indigitall.DidReceiveNotificationRequest(this.request, this.contentHandler);
    }

    public override void TimeWillExpire()
    {
        if (contentHandler != null && bestAttemptContent != null)
        {
            contentHandler(bestAttemptContent);
        }
    }
}

```

**Important Notes (iOS)**

* Supported formats: .caf, .aiff, .wav.
* Maximum length: 30 seconds. If longer, iOS will fall back to the default sound.
* Files must be bundled with the app; they cannot be downloaded dynamically.
* If the sound file is missing or misnamed, the system default sound will play instead.