Channels for the .NET Package
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.
Accessing the Airship Channel ID
Apps can access the Channel ID directly through the SDK.
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.
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.
Categories