# Channels for the Apple SDK

Access and manage channel IDs, listen for channel creation, and configure the channel capture tool.

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.

If `AirshipMessageCenter` is installed, the SDK will attempt to restore the Channel ID across app reinstalls.

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.


#### Swift


```swift
let channelID = Airship.channel.identifier
```



#### Objective-C


```objc
NSString *channelID = UAirship.channel.identifier;
```




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.


#### Swift


Using `identifierUpdates` (AsyncStream):

```swift
Task {
    for await channelID in Airship.channel.identifierUpdates {
        print("Channel ID: \(channelID)")
    }
}
```


Using `NotificationCenter`:

```swift
NotificationCenter.default.addObserver(
    self,
    selector: #selector(refreshView),
    name: AirshipNotifications.ChannelCreated.name,
    object: nil
)
```



#### Objective-C


Using `NotificationCenter`:

```objc
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshView) name:UAirshipNotificationChannelCreated.name object:nil];
```




## Channel Capture tool

The Channel Capture tool is a feature built into the SDK that helps users find their Channel ID. For detailed information about how it works and how to use it, see [Finding Channel IDs](https://www.airship.com/docs/guides/getting-started/developers/identifiers/).

The Channel Capture tool can be disabled through the Airship Config options passed to `takeOff` during SDK initialization. For information about setting up the Airship SDK and configuring `AirshipConfig`, see [iOS SDK Setup](https://www.airship.com/docs/developer/sdk-integration/apple/installation/getting-started/).


#### Swift


```swift
config.isChannelCaptureEnabled = false
```



#### Objective-C


```objc
config.isChannelCaptureEnabled = NO;
```




## 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 takeOff.

For more information about Privacy Manager, see [Privacy Manager](https://www.airship.com/docs/developer/sdk-integration/apple/data-collection/privacy-manager/).

