Delay Channel Registration

When an end user runs your application for the first time after installing it, a Channel is created and returned to Urban Airship. The channel registration automatically occurs on the application’s first run. This Channel then becomes the primary identifier used to address notifications and/or messages to the device.

In special situations where you do not want channel registration to occur on the application’s first run, a configuration flag can be used to delay channel registration and a method can be used to enable channel registration. Once a channel is created, the flag will be ignored.

iOS

  1. To delay channel registration, add the channelCreationDelayEnabled flag and set it to YES in the AirshipConfig.plist file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  ...
  <key>channelCreationDelayEnabled</key>
  <true/>
</dict>
</plist>
  1. Then enable channel registration by calling the enableChannelCreation method.
UAirship.push().enableChannelCreation()
[[UAirship push] enableChannelCreation];

Android

  1. To delay channel registration, add the AirshipConfigOptions.channelCreationDelayEnabled flag and set it to true in the airshipconfig.properties file.
# delay channel registration
channelCreationDelayEnabled = true
  1. Then enable channel registration by calling the PushManager.enableChannelCreation method.
UAirship.shared().getPushManager().enableChannelCreation();