# .NET Integrate the Airship SDK into your .NET MAUI applications for iOS and Android. # Deep Links > Configure deep link handling for Airship messaging. Deep linking allows Airship messaging to open your app to specific resources or screens. When a user interacts with a message (notification, in-app message, etc.), the deep link can navigate them directly to the relevant content in your app. ## Listening for deep links The SDK provides a way to listen for deep links so you can handle them in your app. This handler receives all deep links except for Message Center and Preference Center display requests, which are handled automatically by their respective features. > **Note:** For Message Center and Preference Center display requests, see [Message Center: Getting Started](https://www.airship.com/docs/developer/sdk-integration/dotnet/message-center/getting-started/) and [Preference Center: Getting Started](https://www.airship.com/docs/developer/sdk-integration/dotnet/preference-center/getting-started/). ```csharp Airship.Instance.OnDeepLinkReceived += (object sender, DeepLinkEventArgs e) => { Uri uri = new Uri(e.DeepLink); // Handle deep link }; ``` # .NET Package Changelog > The latest updates to the Airship .NET MAUI library. See the [SDK Support Policy](https://www.airship.com/docs/reference/sdk-support-policy/) for version coverage and maintenance windows. ## 21.3.0 March 21, 2026 Minor release that updates the iOS SDK to 20.6.0 and Android SDK to 20.4.0, adding Native Message Center support, Scene improvements, and fixing deep links in Message Center messages on iOS. ### Changes - Updated iOS SDK to 20.6.0 - Updated Android SDK to 20.4.0 - Fixed deep links inside Message Center messages not working on iOS - Adjusted Markdown rendering in Scenes to be less aggressive when interpreting styling delimiters inside words - Improved Scene border rendering when rounded corners are present - Improved accessibility for single choice and multiple choice questions in Scenes (iOS) - Fixed Message Center unread indicator to only show for unread messages (iOS) ## 21.2.0 February 1, 2026 Minor release that adds programmatic deep link handling for iOS. ### Changes - Updated iOS SDK to 20.3.0 - Added `Airship.ProcessDeepLink()` for programmatic deep link handling (iOS) ## 21.1.0 January 30, 2026 ## 21.0.0 January 21, 2026 Major release that moves Message Center inbox functionality into the main package, updates native SDKs to 20.1.1, and upgrades to .NET 10. ### Changes - Updated to .NET 10.0 (`net10.0-android` and `net10.0-ios`) - Updated iOS SDK to 20.1.1 - Updated Android SDK to 20.1.1 - Moved Message Center inbox functionality (`IAirshipMessageCenter`, `Message` model) from `Airship.Net.MessageCenter` to `Airship.Net` - Changed Message Center access pattern from extension method to static property: `Airship.Instance.MessageCenter()` → `Airship.MessageCenter` - `Airship.Net.MessageCenter` package now contains only MAUI UI components (Controls) - Updated iOS minimum version to iOS 16+ - Updated MAUI Controls dependency to 9.0.0 See the [Migration Guide](https://github.com/urbanairship/airship-dotnet/blob/main/MIGRATION.md) for upgrade instructions. ## 20.2.1 January 2, 2026 Minor release to update SDKs and resolve crashes caused by calling iOS SDK methods on background threads instead of the main thread. ### Changes - Resolve crashes caused by calling iOS SDK methods on background threads instead of the main thread. - Updated iOS SDK to 19.11.5 - Updated Android SDK to 19.13.6 ## 20.2.0 October 8, 2025 Minor release that updates the SDKs and restores onMessageCenterDisplay. ### Changes - Restored onMessageCenterDisplay that was erroneously removed in version 20.0.0. - Updated iOS SDK to 19.11.0 - Updated Android SDK to 19.13.4 ## 20.1.0 August 26, 2025 Minor release that updates the SDKs and fixes a build signing issue with iOS. ### Changes - Removed embedded framework that failed to be signed during a release build. - Updated iOS SDK to 19.8.2 - Updated Android SDK to 19.11.0 ## 20.0.0 August 11, 2025 Major release with complete interface modernization and architectural improvements. ### Changes - Updated iOS SDK to 19.6.1 - Updated Android SDK to 19.8.0 - Complete interface modernization - split monolithic IAirship into module-specific interfaces - Changed access pattern from instance-based to static module properties - All async operations now return Tasks - Merged Message Center functionality into main Airship.Net package - Added iOS AirshipWrapper to handle Swift async method compatibility - Improved type safety and separation of concerns across modules ## 19.5.0 February 8, 2025 Minor release that updates the Android SDK to 18.7.0, including AndroidX library updates. ### Changes - Updated Android SDK to 18.7.0 ## 19.4.1 December 13, 2024 Minor release that updates the Airship.Net package to no longer depend on MAUI and adds methods to fetch channel and contact subscription lists to the cross-platform library. ### Changes - Removed unnecessary MAUI dependency from Airship.Net - Added `FetchChannelSubscriptionLists` and `FetchContactSubscriptionLists` methods to Airship.Net ## 19.4.0 July 29, 2024 Minor release that updates the Airship SDK to iOS 17.10.1 and Android 17.8.1. ### Changes - Updated iOS SDK to 17.10.1 - Updated Android SDK to 17.8.1 [View Older Releases](https://github.com/urbanairship/airship-dotnet/releases?q=created%3A%3C2024-05-15&expanded=true) # .NET Package Resources > API documentation, source code, and changelogs for the Airship .NET library. ## API References * [API docs](https://www.airship.com/docs/reference/libraries/maui/latest/) ## GitHub * [Source](https://github.com/urbanairship/airship-dotnet) * [Sample](https://github.com/urbanairship/airship-dotnet/tree/main/MauiSample) ## Changelog * [.NET Changelog](https://www.airship.com/docs/developer/sdk-integration/dotnet/changelog/) ## License All Airship SDKs and frameworks are open sourced and licensed under Apache Software License 2.0. ## SDK Installation Complete installation and configuration guides for the Airship .NET package. # Getting Started > How to install the Airship .NET package.We provide native binding packages for iOS and Android, and cross-platform .NET packages for core functionality and features: * **Airship Native Bindings**: The native bindings contain all the functionality of the iOS/Android SDKs, but provide no cross-platform interface. They can be found under the `UrbanAirship` namespace for Android and the `Airship` namespace for iOS. * **Airship .NET Library**: The `Airship.Net` package exposes a common subset of functionality between the iOS and Android SDKs. This library can be used within shared codebases (e.g., a .NET MAUI app). * **Airship .NET MessageCenter Library**: The `Airship.Net.MessageCenter` package exposes a custom message view control that can be used to display Message Center messages in shared codebases. ## Setup > **Note:** This guide applies to apps built with .NET MAUI. If your app uses Xamarin and Xamarin.Forms, please refer to the [Airship Xamarin Setup](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/) guide. Before you begin, set up Push and any other Airship features for [Mobile](https://www.airship.com/docs/developer/sdk-integration/). The .NET bindings, like the SDKs that they wrap, are platform-specific, so this would be a good time to familiarize yourself with the SDK APIs and features for each platform you wish to target. ## Android Integration The following packages are available for Android integration with .NET MAUI. ### Android Packages | Package name | Description | |--------------------------------------|----------------------------------------------------------------| | Airship.Net.Android.Core | Core SDK support | | Airship.Net.Android.Adm | ADM push provider support | | Airship.Net.Android.Fcm | FCM push provider support | | Airship.Net.Android.Automation | In-App Automation, In-App Messaging, and Landing pages support | | Airship.Net.Android.MessageCenter | Message Center support | | Airship.Net.Android.PreferenceCenter | Preference Center support | | Airship.Net.Android.Layout | Layout support | | Airship.Net.Android.LiveUpdate | Live Update support | | Airship.Net.Android.FeatureFlag | Feature Flag support | ### Push Provider The Airship SDK for Android is split into modules which allow you to choose the push providers included in your application. You must install at least one push provider in your Android app. You can install more than one provider. Add the packages directly to your `.csproj` file by editing it and adding the appropriate `PackageReference` entries. Here's an example showing how to add the FCM push provider along with common feature modules: **Example `.csproj` with Android packages** ```xml ``` > **Note:** Replace `19.13.6` with the latest version available on [NuGet](https://www.nuget.org/packages?q=Airship.Net.Android). ### Airship Config Airship config options are a convenient way to pass custom settings to your app without needing to edit the source code. By default, the Airship SDK loads these settings from the `airshipconfig.properties` file located in your application's `Assets` directory for the Android platform. In the default MAUI single-project structure, this should be located at `Platforms/Android/Assets`. You may need to create the `Assets` directory, if it doesn't already exist. Use this file, among other things, to set the backend credentials for your app, and to toggle between development and production builds. In order for this file to be visible to the SDK during TakeOff, be sure that its `Build Action` is set to `AndroidAsset` in your app project. **Example `airshipconfig.properties`** ```ruby developmentAppKey = Your Development App Key developmentAppSecret = Your Development App Secret productionAppKey = Your Production App Key productionAppSecret = Your Production Secret # Toggles between the development and production app credentials # Before submitting your application to an app store set to true inProduction = false # LogLevel is "VERBOSE", "DEBUG", "INFO", "WARN", "ERROR" or "ASSERT" developmentLogLevel = DEBUG productionLogLevel = ERROR # Notification customization notificationIcon = ic_notification notificationAccentColor = #ff0000 ``` The `airshipconfig.properties` file should be placed in `Platforms/Android/Assets/` and its `Build Action` should be set to `AndroidAsset` in the properties panel. ### EU Cloud Site If your app uses Airship's EU cloud site, you will need to add that to `airshipconfig.properties`. ```ruby # EU Cloud Site site = EU ``` ### FCM-specific instructions Follow [FCM Android Setup](https://firebase.google.com/docs/android/setup) and [FCM Push Provider Setup](https://www.airship.com/docs/developer/sdk-integration/android/installation/getting-started/#fcm-setup) to configure your application to use FCM. For MAUI apps, ensure your `google-services.json` file is placed in `Platforms/Android/` with `Build Action` set to `GoogleServicesJson`. ### TakeOff Create a class that extends `Autopilot` in `Platforms/Android` and register your Autopilot in the Android `AssemblyInfo.cs` file to generate the required metadata in the `AndroidManifest.xml` file. If needed, create a new `AssemblyInfo.cs` file in the `Platforms/Android/Properties/` directory. **Platforms/Android/SampleAutopilot.cs** ```c# using UrbanAirship; namespace ExampleApp; [Register("com.example.SampleAutopilot")] public class SampleAutopilot : Autopilot { public override void OnAirshipReady(UAirship airship) { // perform any post takeOff airship customizations } public override AirshipConfigOptions CreateAirshipConfigOptions(Context context) { /* Optionally set your config at runtime AirshipConfigOptions options = new AirshipConfigOptions.Builder() .SetInProduction(!BuildConfig.DEBUG) .SetDevelopmentAppKey("Your Development App Key") .SetDevelopmentAppSecret("Your Development App Secret") .SetProductionAppKey("Your Production App Key") .SetProductionAppSecret("Your Production App Secret") .SetNotificationAccentColor(ContextCompat.getColor(this, R.color.color_accent)) .SetNotificationIcon(R.drawable.ic_notification) .Build(); return options; */ return base.CreateAirshipConfigOptions(context); } } ``` **Platforms/Android/Properties/Assemblyinfo.cs** ```c# using Android.App; [assembly: MetaData("com.urbanairship.autopilot", Value = "com.example.SampleAutopilot")] ``` **Platforms/Android/MainActivity.cs** ```c# using UrbanAirship; namespace ExampleApp; [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) { Autopilot.AutomaticTakeOff(this.ApplicationContext); //... } } ``` ## iOS Integration The following packages are available for iOS integration with .NET MAUI. ### iOS Packages The Airship .NET component comes with full native bindings for the iOS SDK via the `Airship.Net.iOS.ObjectiveC` package. | Package name | Description | |-------------------------------|----------------------------------------------------| | Airship.Net.iOS.ObjectiveC | Full iOS SDK bindings (Core, Automation, Message Center, Preference Center, Feature Flags) | Add the iOS package directly to your `.csproj` file by editing it and adding the appropriate `PackageReference` entry: **Example `.csproj` with iOS package** ```xml ``` > **Note:** Replace `19.11.5` with the latest version available on [NuGet](https://www.nuget.org/packages/Airship.Net.iOS.ObjectiveC). ### Airship Config Provide an `AirshipConfig.plist` file with the application's configuration in the `Platforms/iOS` folder. In order for this file to be visible to the SDK during TakeOff, be sure that its `Build Action` is set to `BundleResource` in your app project. **Example `AirshipConfig.plist`** ```xml detectProvisioningMode developmentAppKey Your Development App Key developmentAppSecret Your Development App Secret productionAppKey Your Production App Key productionAppSecret Your Production App Secret ``` The `AirshipConfig.plist` file should be placed in `Platforms/iOS/` and its `Build Action` should be set to `BundleResource` in the properties panel. ### EU Cloud Site If your app uses Airship's EU cloud site, you will need to add that to `AirshipConfig.plist`. ```xml site EU ``` ### TakeOff The Airship SDK requires only a single entry point in the app delegate, known as *takeOff*. Inside your application delegate's `FinishedLaunching` method, initialize a shared `UAirship` instance by calling `takeOff`. This will bootstrap the SDK and look for settings specified in the `AirshipConfig.plist` config file. > **Note:** If the `takeOff` process fails due to improper or missing configuration, the shared > `UAirship` instance will be `null`. The Airship SDK always logs implementation errors at > high visibility. **Example takeOff** ```c# using Airship; namespace ExampleApp; [Register ("AppDelegate")] public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) { // Populate AirshipConfig.plist with your app's info from https://go.urbanairship.com // or set runtime properties here. NSError configError; UAConfig config = UAConfig.DefaultConfigWithError(out configError); if (config == null || configError != null) { throw new InvalidOperationException($"Failed to load Airship configuration: {configError?.LocalizedDescription ?? "Unknown error"}"); } NSError error; bool success = UAirship.TakeOff(config, launchOptions as NSDictionary, out error); if (!success || error != null) { throw new InvalidOperationException($"Failed to initialize Airship: {error?.LocalizedDescription ?? "Unknown error"}"); } // Configure Airship here return base.FinishedLaunching(application, launchOptions); } } ``` ### Notification Service Extension In order to take advantage of iOS notification attachments, such as images, animated gifs, and video, you will need to create a Notification Service Extension target in your project. Follow the [iOS Notification Service Extension Guide](https://www.airship.com/docs/developer/sdk-integration/apple/push-notifications/notification-service-extension/) for setup instructions. ### Notification Content Extension The iOS SDK's Notification Content Extension provides support for carousel UI. Follow the [iOS Notification Content Extension Guide](https://www.airship.com/docs/developer/sdk-integration/apple/installation/getting-started/#notification-content-extension) for setup instructions. ## .NET Shared Components Installation {#maui-component-installation} Installing the Airship components is a quick and easy process, seamlessly integrated into Visual Studio. You have two installation options: * **Native bindings**: If you are only working with one platform, or if there is no reason for you to have a shared codebase between your platform projects, this may be an appropriate option. It's possible to make use of the native bindings * **Airship.NET + native bindings**: If you are working with multiple platforms, and you have a shared codebase (e.g., a MAUI app), this may be an appropriate option. You can use the Airship .NET libraries in the shared codebase, while the native bindings can handle platform-specific calls in each platform folder or project. Platform-specific native bindings can also be called directly from cross-platform code, using [conditional compilation](https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/invoke-platform-code?view=net-maui-8.0#conditional-compilation). All components can be installed by editing your `.csproj` file directly or via the NuGet package manager in Visual Studio or the `dotnet` CLI. > **Note:** After adding platform-specific binding packages, inspect your `.csproj` file to make sure that > the `ItemGroup` or `PackageReference` includes the correct `Condition` attribute for your .NET > version and target platform: > > ```xml > > > > > > > > > > > > ``` ### Cross-Platform Library To use the cross-platform Airship .NET library, add it to your `.csproj` file: ```xml ``` > **Note:** The Airship SDK packages were updated in 2018 to reflect the modularization of the Android SDK, which is > now split into Core, ADM, FCM, and a set of feature modules. The original package named `urbanairship` is deprecated > and out of date, but currently remains in NuGet. The `airship.netstandard` package is not compatible with .NET MAUI > and is only appropriate for use in apps built with the older Xamarin Forms framework. > > When in doubt, check the release date of the package before installing. ## Native Bindings Using the native binding libraries is similar to using either the Android or iOS SDKs. Below we provide a simple comparison between setting a named user ID in the native SDK and binding library. In general, the two changes you will notice between the bindings and SDKs are: * Method calls are generally capitalized. * Getters/setters are generally converted into properties. ### Android **Native Java Call** ```java // Set the named user ID UAirship.shared().contact().identify("NamedUserID"); ``` **Binding Library** ```c# // Set the named user ID UAirship.Shared().Contact.Identify("NamedUserID"); ``` For more information on the Android SDK, please see the [Android platform documentation](https://www.airship.com/docs/developer/sdk-integration/android/). ### iOS **Native Swift Call** ```swift // Set the named user ID Airship.contact.identify("NamedUserID") ``` **Binding Library** ```c# // Set the named user ID UAirship.Contact.Identify("NamedUserID"); ``` For more information on the iOS SDK, please see the [iOS platform documentation](https://www.airship.com/docs/developer/sdk-integration/apple/). ## Airship .NET Library The Airship .NET library provides a unified interface for common SDK calls, allowing users to place common code in a shared location. This is ideal for working with MAUI -- simply add the `Airship.Net` NuGet dependency and all of these calls should be available from your shared codebase. > **Note:** Because the Airship.NET library currently has no shared interface for initializing > the app (i.e., calling `takeOff`), you must install the native bindings for each platform target and add platform-specific calls to initialize Airship > in your platform-specific sources or projects. The Airship .NET library is accessible through the `Airship` class, found in the `AirshipDotNet` namespace. Full documentation for the .NET library can be found [here](https://www.airship.com/docs/reference/libraries/maui/latest/). If you don't see a channel ID in the logcat or encounter errors during initialization, see [Troubleshooting Initialization](https://www.airship.com/docs/developer/sdk-integration/dotnet/troubleshooting/initialization/) for common problems and solutions. # Logging > Configure log levels to control how the Airship SDK logs messages. The Airship SDK provides configurable log levels to help you debug issues without overwhelming the console. By default, the log level is set to **Info** for development builds and **Error** for production builds to ensure clean logs in a live environment. ## Log levels The following log levels are available, ordered from most to least verbose. | Log Level | Description | | :-------- | :---------- | | **Verbose** | Reports highly detailed SDK status, which is useful for deep debugging and troubleshooting. | | **Debug** | Reports general SDK status with more detailed information than `Info`. | | **Info** | Reports general SDK status and lifecycle events. | | **Warning** | Used for API deprecations, invalid setup, and other potentially problematic situations that are generally recoverable. | | **Error** | Used for critical errors, exceptions, and other situations that the SDK cannot gracefully handle. | | **Assert** | Disables all logging. | ## Configuring log levels You can set the log level in the Airship config files for Android and iOS. ### Android In your `airshipconfig.properties` file: ```text # Available log levels: VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT productionLogLevel = VERBOSE developmentLogLevel = VERBOSE ``` ### iOS In your `AirshipConfig.plist` file: ```xml productionLogLevel TRACE developmentLogLevel TRACE ``` # Locale > Configure locale behavior and override the default locale that Airship uses. > **Note:** Locale configuration is not supported in the Airship .NET library. Use native binding methods instead. ## Push Notifications Configure and implement push notifications for iOS and Android platforms. # Push Notifications > How to configure your application to receive and respond to notifications. ## Enable User Notifications Enabling `userNotificationsEnabled` will prompt the user for permission to send notifications. To increase the likelihood that the user will accept, you should avoid prompting the user for permission immediately, and instead wait for a more appropriate time in the app. The Airship SDK makes a distinction between `user notifications`, which can be seen by the user, and other forms of push that allow you to send data to your app silently, or in the background. Enabling or disabling user notifications is a preference often best left up to the user, so by default, user notifications are disabled. ```csharp Airship.Instance.UserNotificationsEnabled = true ``` > **Note:** For apps that target Android 13 (API 33) and above, enabling user notifications will display a runtime permission prompt to allow notifications to be sent. > > To increase the likelihood that the user will accept, you should avoid prompting the user for permission immediately on app startup, and instead wait for a more appropriate time to prompt for notification permission. ## Handle Notification Events The Airship SDK provides several callbacks for when a push is received or a notification is interacted with. Apps can use these callbacks to do custom push processing. Registering for a callback is optional, the SDK will automatically launch the application without the need to set a callback. > **Note:** Notification callbacks are not supported in Airship.NET library. Use native binding methods instead. ## Silent Notifications Silent notifications are push messages that do not present a notification to the user. These are typically used to briefly wake the app from a background state to perform processing tasks or fetch remote content. > **Important:** We recommend that you thoroughly test your implementation to confirm that silent notifications do not generate any device notifications. For Android, all push messages are delivered in the background, but default Airship will treat messages without an `alert` as silent. For iOS, set the `content_available` property to `true` in the [iOS override object](https://www.airship.com/docs/developer/rest-api/ua/schemas/platform-overrides/#iosoverrideobject). > **Note:** Pushes sent with the `content_available` property (iOS) or without an `alert` (Android) do not have guaranteed delivery. Factors affecting delivery include battery life, whether the device is connected to WiFi, and the number of silent pushes sent within a recent time period. These metrics are determined solely by iOS/Android and APNs/FCM. Therefore, this feature is best used for supplementing the regular behavior of the app rather than providing critical functionality. For instance, an app could use a silent push to pre-fetch new data ahead of time in order to reduce load times when the app is later launched by the user. ## iOS Notification Options > **Note:** iOS notification options, badges, and quiet time are not supported in Airship.NET library. Use native binding methods instead. If push notifications aren't working as expected, see [Troubleshooting Push Notifications](https://www.airship.com/docs/developer/sdk-integration/dotnet/troubleshooting/push-notifications/) to check notification status and fix common issues. ## Message Center Implement Message Center to provide an inbox for rich HTML-based messages. # Message Center > The default Message Center is available for .NET MAUI with minimal integration required. Basic theming options are supported. Message Center provides an inbox for rich, HTML-based messages that users can view at their convenience. By default, when your app receives a push notification with a Message Center action, the Message Center automatically displays. You can also display the Message Center manually by calling a simple method, making it easy to add a Message Center button to your app's navigation. Message Center inboxes are associated with channel IDs. Each device has a unique channel ID that persists across app launches, allowing users to access their message history. ## Display the Message Center Display the Message Center with a single method call: ```csharp Airship.Instance.DisplayMessageCenter(); ``` ## Override Default Display Behavior To use a custom Message Center implementation instead of the default UI, set an event handler: ```csharp Airship.Instance.OnMessageCenterDisplay += OnMessageCenterDisplay; static void OnMessageCenterDisplay(object sender, MessageCenterEventArgs e) { // Navigate to your custom Message Center UI // e.MessageId is optional - null means show the full message list } ``` ## Fetch Messages Retrieve messages from the inbox: ```csharp var messages = Airship.Instance.InboxMessages; ``` ## Listen for Message Updates Subscribe to message updates using events: ```csharp Airship.Instance.InboxMessages(messages => { // Handle messages }); ``` ## Listen for Unread Count Changes Subscribe to unread count updates: ```csharp var unreadCount = Airship.Instance.UnreadCount; // Update badge or UI ``` ## Refresh Messages Manually refresh the message list from the server: ```csharp Airship.Instance.FetchInboxMessages(success => { // Handle result }); ``` ## Mark Messages as Read Mark one or more messages as read: ```csharp Airship.Instance.MarkMessageRead("message-id"); ``` ## Delete Messages Delete one or more messages: ```csharp Airship.Instance.DeleteMessage("message-id"); ``` # Advanced Customizations > Airship's SDK provides a simple interface for managing the Message Center within your .NET MAUI application. This guide covers creating custom Message Center implementations for .NET MAUI applications. ## Prerequisites Message Center requires the Airship .NET MAUI SDK to be installed. See the [SDK installation guide](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/) for setup instructions. ## Custom Message Center Implementation For complete control over Message Center placement and navigation, create a custom implementation using the Message Center components. ### Custom Display Handling Set up custom display handling: ```csharp Airship.Instance.OnMessageCenterDisplay += OnMessageCenterDisplay; static void OnMessageCenterDisplay(object sender, MessageCenterEventArgs e) { // Navigate to your custom Message Center UI // e.MessageId is optional - null means show the full message list } ``` ## Related Documentation - [Getting Started with Message Center](https://www.airship.com/docs/developer/sdk-integration/dotnet/message-center/getting-started/) - [Installing the Airship SDK](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/) ## Preference Center Implement Preference Center to let users control their subscription preferences. # Preference Center > Preference Center allows users to opt in and out of subscription lists configured via the Airship Dashboard. > **Important:** Airship Preference Centers are widgets that can be embedded in a page in an app or website. Please verify with your legal team that your full Preference Center page, including any web page for email Preference Centers, is compliant with local privacy regulations. Preference Center provides a pre-built UI for users to manage their subscription preferences. Learn more in the [Preference Center user guide](https://www.airship.com/docs/guides/messaging/features/preference-centers/). > **Note:** Preference Center display is not supported in the Airship.NET library. Use native platform methods or build a custom implementation. # Advanced Customizations > Advanced customization options for Preference Center. This guide covers creating custom Preference Center implementations for .NET MAUI applications. ## Prerequisites Preference Center requires the Airship .NET MAUI SDK to be installed. See the [SDK installation guide](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/) for setup instructions. ## Custom Preference Centers Preference Center is not supported in the Airship.NET library. Use native binding methods instead. ## Related Documentation - [Getting Started with Preference Center](https://www.airship.com/docs/developer/sdk-integration/dotnet/preference-center/getting-started/) - [Installing the Airship SDK](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/) ## Audience Management Integrate audience management features into your .NET app. This guide covers how to identify contacts, access channel IDs, and set tags, attributes, and subscription lists on channels and contacts. For information about using these features for segmentation and targeting, see the [Audience User Guide]({{< ref "/guides/audience/segmentation/segmentation.md" >}}). # Channels > Access and manage channel IDs and listen for channel creation. Each device/app install will generate a unique identifier known as the Channel ID. Once a Channel ID is created, it will persist in the application until the app is reinstalled, or has its internal data is cleared. For information about finding Channel IDs, using the Channel Capture tool, and other methods to access Channel IDs, see [Finding Channel IDs](https://www.airship.com/docs/guides/getting-started/developers/identifiers/). ## Accessing the Airship Channel ID Apps can access the Channel ID directly through the SDK. ```csharp string channelId = Airship.Instance.ChannelId; ``` The Channel ID is asynchronously created, so it may not be available right away on the first run. Changes to Channel data will automatically be batched and applied when the Channel is created, so there is no need to wait for the Channel to be available before modifying any data. Applications that need to access the Channel ID can use a listener to be notified when it is available. ```csharp static void OnChannelCreation(object sender, ChannelEventArgs args) { Console.WriteLine("Channel created: " + args.ChannelId); } Airship.Instance.OnChannelCreation += OnChannelCreation; ``` ## Delaying channel creation Airship creates the channel if at least one feature is enabled in the Privacy Manager. To delay channel creation, use the Privacy Manager to disable all features during initialization. For more information about Privacy Manager, see [SDK Data Collection](https://www.airship.com/docs/reference/data-collection/sdk-data-collection/). # Contacts > Identify contacts, reset contacts, and get named user IDs. A Contact is any user in your project. Contacts are identified as either an Anonymous Contact or a Named User. Airship can set targeting data on these identifiers, which are also used to map devices and channels to a specific user. For detailed information about contacts and named users, see [Named users](https://www.airship.com/docs/guides/audience/named-users/). ## Managing the Contact's identifier (Named User ID) Identify can be called multiple times with the same Named User ID. The SDK will automatically deduplicate `identify` calls made with the same Named User ID. If the ID is changed from a previous value, the Contact will automatically be dissociated from the previous Named User ID. ```csharp Airship.Instance.Contact.Identify("some named user ID"); ``` If the user logs out of the device, you may want to reset the contact. This will clear any anonymous data and dissociate the contact from the Named User ID, if set. This should only be called when the user manually logs out of the app, otherwise you will not be able to target the Channel by its Contact data. ```csharp Airship.Instance.Contact.Reset(); ``` You can get the Named User ID only if you set it through the SDK. ```csharp string namedUserId = await Airship.Instance.Contact.GetNamedUserIdAsync(); ``` # Tags > Set device tags, contact tags, and tag groups for audience segmentation. For information about tags, including how to use them for segmentation and targeting, see the [Tags user guide](https://www.airship.com/docs/guides/audience/tags/). ## Channel Tags Channel tags are tags managed on the Channel by the SDK. Device tags (tags without a group) can be modified or fetched from the Channel. ```csharp // Add tags Airship.Instance.Channel.EditTags() .Add("one") .Add("two") .Add("three") .Apply(); // Add a tag Airship.Instance.Channel.EditTags() .Add("a_tag") .Apply(); // Remove a tag Airship.Instance.Channel.EditTags() .Remove("a_tag") .Apply(); // Accessing channel tags IEnumerable tags = await Airship.Instance.Channel.GetTagsAsync(); ``` ## Channel Tag Groups Tag groups are tags scoped within a group. Tag groups can be modified from the SDK but cannot be fetched. Device tags (tags without a group) can be fetched. If you need to be able to fetch tag groups, consider using subscription lists. ```csharp Airship.Instance.Channel.EditTagGroups() .Add("silver-member", "loyalty") .Add("gold-member", "loyalty") .Set(new string[] { "bingo" }, "games") .Remove("bronze-member", "loyalty") .Remove("club-member", "loyalty") .Apply(); ``` ## Contact Tag Groups Contact tag groups are tags scoped within a group at the Contact level. Tag groups can be modified from the SDK but cannot be fetched. If you need to be able to fetch tag groups, consider using subscription lists. ```csharp Airship.Instance.Contact.EditTagGroups() .Add("silver-member", "loyalty") .Add("gold-member", "loyalty") .Set(new string[] { "bingo" }, "games") .Remove("bronze-member", "loyalty") .Remove("club-member", "loyalty") .Apply(); ``` ## Verifying Tags To verify that tags have been set correctly, look up the channel or contact in the [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/) view. You can search by Channel ID or Named User ID to view the tags and tag groups associated with a channel or contact. # Attributes > Set channel and contact attributes as key-value pairs for personalization. For information about Attributes, including overview, use cases, and how to target Attributes, see [About Attributes](https://www.airship.com/docs/guides/audience/attributes/about/). ## Channel Attributes Channel attributes are attributes managed on the Channel by the SDK. ```csharp Airship.Instance.Channel.EditAttributes() .SetAttribute("device_name", "Bobby's Phone") .SetAttribute("average_rating", 4.99) .RemoveAttribute("vip_status") .Apply(); ``` ## Contact Attributes Contact attributes are attributes managed on the Contact by the SDK. ```csharp Airship.Instance.Contact.EditAttributes() .SetAttribute("first_name", "Bobby") .Apply(); ``` ## Verifying Attributes To verify that attributes have been set correctly, look up the channel or contact in the [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/) view. You can search by Channel ID or Named User ID to view the attributes associated with a channel or contact. # Subscription Lists > Manage channel and contact subscription lists for topic-based messaging. For information about Subscription Lists, including overview, use cases, and how to create subscription lists, see [Subscription Lists](https://www.airship.com/docs/guides/audience/segmentation/audience-lists/subscription/). ## Channel Subscription Lists Channel subscriptions apply only to the single channel. ```csharp // Modifying channel subscription lists Airship.Instance.Channel.EditSubscriptionLists() .Subscribe("food") .Unsubscribe("sports") .Apply(); // Fetching channel subscription lists List channelSubscriptions = await Airship.Instance.Channel.FetchSubscriptionLists(); ``` ## Contact Subscription Lists Contact subscriptions are set at the user-level and require a Channel scope specifying the types that the subscription list applies to. ```csharp // Modifying contact subscription lists Airship.Instance.Contact.EditSubscriptionLists() .Subscribe("food", ChannelScope.App) .Unsubscribe("sports", ChannelScope.Sms) .Apply(); // Fetching contact subscription lists Dictionary> subscriptions = await Airship.Instance.Contact.GetSubscriptionListsAsync(); ``` ## Verifying Subscription Lists To verify that subscription lists have been set correctly, look up the channel or contact in the [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/) view. You can search by Channel ID or Named User ID to view the subscription lists associated with a channel or contact. ## Data Collection Overview of data collection and controls provided by the Airship .NET SDK. # Privacy Manager > Use Privacy Manager to enable or disable Airship SDK features for privacy and consent management. > **Note:** Privacy Manager is not supported in the Airship .NET library. Use native binding methods instead. For information about what data is collected for each Privacy Manager flag, see [SDK Data Collection](https://www.airship.com/docs/reference/data-collection/sdk-data-collection/). # Analytics > Track user engagement and app performance with Airship analytics, including custom events, screen tracking, and associated identifiers. > **Note:** Analytics events are batched and uploaded asynchronously in the background to minimize battery impact. The database size is fixed, so events are safely stored even when offline. Events may not upload immediately and may wait until the next app initialization if the app is closed before the upload completes. ## Custom Events Track user activities and key conversions with custom events. They require enabling analytics for your app. For detailed information, see the [Custom Events guide](https://www.airship.com/docs/guides/audience/events/custom-events/). ```csharp CustomEvent customEvent = new CustomEvent(); customEvent.EventName = "event_name"; customEvent.EventValue = 123.45; customEvent.AddProperty("my_custom_property", "some custom value"); customEvent.AddProperty("is_neat", true); Airship.Instance.AddCustomEvent(customEvent); ``` ## Associated Identifiers Associated identifiers (also called custom identifiers) associate an external identifier with a [Channel ID](https://www.airship.com/docs/reference/glossary/#channel_id). They are visible in [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds). We recommend adding any IDs that you may want to be visible in your event stream. You can assign up to 20 associated identifiers to a device. Unlike other identifiers (e.g., tags), you cannot use associated identifiers to target your users. ```csharp Airship.Instance.AssociateIdentifier("key", "value"); ``` ## Screen Tracking The Airship SDK gives you the ability to track which screens a user views within the application, how long a user stayed on each screen, and also includes the user's previous screen. These events then come through [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds), allowing you to see the path a user took through the application, or trigger actions based on a user visiting a particular area of the application. ```csharp Airship.Instance.TrackScreen("MainScreen"); ``` ## Troubleshooting Common issues and solutions for Airship library setup, initialization, and integration. # Troubleshooting Initialization > Troubleshoot common initialization issues and apply solutions. When following steps in [Getting Started](https://www.airship.com/docs/developer/sdk-integration/dotnet/installation/getting-started/), if you don't see a channel ID in the logs or encounter errors during initialization, review the following common problems and solutions. ## Installation Errors If you encounter errors during installation: - Verify that you're using a compatible version of .NET MAUI. - Ensure the NuGet package is properly installed. - Check that your iOS and Android projects are correctly configured. ## Initialization Errors If you encounter errors during SDK initialization: - Verify your credentials in the Airship dashboard. The credentials used by `takeOff` are your Airship project's [App Key](https://www.airship.com/docs/reference/glossary/#app_key) and [App Secret](https://www.airship.com/docs/reference/glossary/#app_secret). To find them, select the dropdown menu (▼) next to your project name, and then **Project details**. - Check that `takeOff` is called correctly in your app. - Ensure both iOS and Android native modules are properly configured. # Troubleshooting Push Notifications > Check push notification status and fix common issues. If [push notifications](https://www.airship.com/docs/developer/sdk-integration/dotnet/push-notifications/) aren't working as expected: - Verify that push notifications are enabled for both iOS and Android. - Check that APNs (iOS) and FCM (Android) are properly configured. - Ensure the app has notification permissions.