UAChannel

@interface UAChannel : UAComponent

This singleton provides an interface to the channel functionality provided by the Airship iOS Push API.

  • The Channel ID.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *identifier;

    Swift

    var identifier: String? { get }
  • Tags for this device.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSArray<NSString *> *_Nonnull tags;

    Swift

    var tags: [String] { get set }
  • Allows setting tags from the device. Tags can be set from either the server or the device, but not both (without synchronizing the data), so use this flag to explicitly enable or disable the device-side flags.

    Set this to NO to prevent the device from sending any tag information to the server when using server-side tagging. Defaults to YES.

    Declaration

    Objective-C

    @property (getter=isChannelTagRegistrationEnabled, assign, readwrite, nonatomic)
        BOOL channelTagRegistrationEnabled;

    Swift

    var isChannelTagRegistrationEnabled: Bool { get set }
  • Adds a tag to the list of tags for the device. To update the server, make all of your changes, then call updateRegistration to update the Airship server.

    Note

    When updating multiple server-side values (tags, alias, time zone, quiet time), set the values first, then call updateRegistration. Batching these calls improves performance.

    Declaration

    Objective-C

    - (void)addTag:(nonnull NSString *)tag;

    Swift

    func addTag(_ tag: String)

    Parameters

    tag

    Tag to be added

  • Adds a collection of tags to the current list of device tags. To update the server, make all of your changes, then call updateRegistration.

    Note

    When updating multiple server-side values (tags, alias, time zone, quiet time), set the values first, then call updateRegistration. Batching these calls improves performance.

    Declaration

    Objective-C

    - (void)addTags:(nonnull NSArray<NSString *> *)tags;

    Swift

    func addTags(_ tags: [String])

    Parameters

    tags

    Array of new tags

  • Removes a tag from the current tag list. To update the server, make all of your changes, then call updateRegistration.

    Note

    When updating multiple server-side values (tags, alias, time zone, quiet time), set the values first, then call updateRegistration. Batching these calls improves performance.

    Declaration

    Objective-C

    - (void)removeTag:(nonnull NSString *)tag;

    Swift

    func removeTag(_ tag: String)

    Parameters

    tag

    Tag to be removed

  • Removes a collection of tags from a device. To update the server, make all of your changes, then call updateRegistration.

    Note

    When updating multiple server-side values (tags, alias, time zone, quiet time), set the values first, then call updateRegistration. Batching these calls improves performance.

    Declaration

    Objective-C

    - (void)removeTags:(nonnull NSArray<NSString *> *)tags;

    Swift

    func removeTags(_ tags: [String])

    Parameters

    tags

    Array of tags to be removed

  • Add tags to channel tag groups. To update the server, make all of your changes, then call updateRegistration.

    Declaration

    Objective-C

    - (void)addTags:(nonnull NSArray<NSString *> *)tags
              group:(nonnull NSString *)tagGroupID;

    Swift

    func addTags(_ tags: [String], group tagGroupID: String)

    Parameters

    tags

    Array of tags to add.

    tagGroupID

    Tag group ID string.

  • Removes tags from channel tag groups. To update the server, make all of your changes, then call updateRegistration.

    Declaration

    Objective-C

    - (void)removeTags:(nonnull NSArray<NSString *> *)tags
                 group:(nonnull NSString *)tagGroupID;

    Swift

    func removeTags(_ tags: [String], group tagGroupID: String)

    Parameters

    tags

    Array of tags to remove.

    tagGroupID

    Tag group ID string.

  • Sets tags for channel tag groups. To update the server, make all of your changes, then call updateRegistration.

    Declaration

    Objective-C

    - (void)setTags:(nonnull NSArray<NSString *> *)tags
              group:(nonnull NSString *)tagGroupID;

    Swift

    func setTags(_ tags: [String], group tagGroupID: String)

    Parameters

    tags

    Array of tags to set.

    tagGroupID

    Tag group ID string.

  • Enables channel creation if channelCreationDelayEnabled was set to YES in the config.

    Declaration

    Objective-C

    - (void)enableChannelCreation;

    Swift

    func enableCreation()
  • Registers or updates the current registration with an API call. If push notifications are not enabled, this unregisters the device token.

    Observe NSNotificationCenterEvents such as UAChannelCreatedEvent, UAChannelUpdatedEvent and UAChannelRegistrationFailedEvent to receive success and failure callbacks.

    Declaration

    Objective-C

    - (void)updateRegistration;

    Swift

    func updateRegistration()