Channel
@objc(UAChannel)
public class Channel : NSObject, Component, ChannelProtocol
This singleton provides an interface to the channel functionality.
-
Notification event when the channel is created.
Declaration
Swift
@objc public static let channelCreatedEvent: NSNotification.Name
-
Channel ID key for channelCreatedEvent and channelUpdatedEvent.
Declaration
Swift
@objc public static let channelIdentifierKey: String
-
Channel existing key for channelCreatedEvent.
Declaration
Swift
@objc public static let channelExistingKey: String
-
Notification event when the channel is updated.
Declaration
Swift
@objc public static let channelUpdatedEvent: NSNotification.Name
-
Notification event when channel registration failed.
Declaration
Swift
@objc public static let channelRegistrationFailedEvent: NSNotification.Name
-
The channel identifier.
Declaration
Swift
public var identifier: String? { get }
-
The channel tags.
Declaration
Swift
public 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
false
to prevent the device from sending any tag information to the server when using server-side tagging. Defaults totrue
.Declaration
Swift
public var isChannelTagRegistrationEnabled: Bool
-
The shared Channel instance.
Declaration
Swift
@objc public static var shared: Channel { get }
-
Begins a tag editing session
Declaration
Swift
@objc public func editTags() -> TagEditor
Return Value
A TagEditor
-
Begins a tag editing session
Declaration
Swift
@objc public func editTags(_ editorBlock: (TagEditor) -> Void)
Parameters
editorBlock
A tag editor block.
Return Value
A TagEditor
-
Begins a tag group editing session
Declaration
Swift
@objc public func editTagGroups() -> TagGroupsEditor
Return Value
A TagGroupsEditor
-
Begins a tag group editing session
Declaration
Swift
@objc public func editTagGroups(_ editorBlock: (TagGroupsEditor) -> Void)
Parameters
editorBlock
A tag group editor block.
Return Value
A TagGroupsEditor
-
Begins a subscription list editing session
Declaration
Swift
@objc public func editSubscriptionLists() -> SubscriptionListEditor
Return Value
A SubscriptionListEditor
-
Begins a subscription list editing session
Declaration
Swift
@objc public func editSubscriptionLists(_ editorBlock: (SubscriptionListEditor) -> Void)
Parameters
editorBlock
A subscription list editor block.
Return Value
A SubscriptionListEditor
-
Fetches subscription lists.
Declaration
Swift
@discardableResult @objc public func fetchSubscriptionLists(completionHandler: @escaping ([String]?, Error?) -> Void) -> Disposable
Parameters
completionHandler
A completion handler.
Return Value
A Disposable.
-
Begins an attributes editing session
Declaration
Swift
@objc public func editAttributes() -> AttributesEditor
Return Value
An AttributesEditor
-
Begins an attributes editing session
Declaration
Swift
@objc public func editAttributes(_ editorBlock: (AttributesEditor) -> Void)
Return Value
An AttributesEditor
-
Adds a device tag.
Declaration
Swift
@available(*, deprecated, message: "Use editTags instead.") @objc(addTag:) public func addTag(_ tag: String)
Parameters
tag
The tag.
-
Adds a list of device tags.
Declaration
Swift
@available(*, deprecated, message: "Use editTags instead.") @objc(addTags:) public func addTags(_ tags: [String])
Parameters
tags
The tags.
-
Removes a device tag.
Declaration
Swift
@available(*, deprecated, message: "Use editTags instead.") @objc(removeTag:) public func removeTag(_ tag: String)
Parameters
tag
The tag.
-
Removes a list of device tags.
Declaration
Swift
@available(*, deprecated, message: "Use editTags instead.") @objc(removeTags:) public func removeTags(_ tags: [String])
Parameters
tags
The tag.
-
Adds a list of tags to a group.
Declaration
Swift
@available(*, deprecated, message: "Use editTagGroups instead.") @objc(addTags:group:) public func addTags(_ tags: [String], group: String)
Parameters
tags
The tags.
group
The tag group.
-
Removes a list of tags from a group.
Declaration
Swift
@available(*, deprecated, message: "Use editTagGroups instead.") @objc(removeTags:group:) public func removeTags(_ tags: [String], group: String)
Parameters
tags
The tags.
group
The tag group.
-
Sets a list of tags to a group.
Declaration
Swift
@available(*, deprecated, message: "Use editTagGroups instead.") @objc(setTags:group:) public func setTags(_ tags: [String], group: String)
Parameters
tags
The tags.
group
The tag group.
-
Applies attribute mutations.
Declaration
Swift
@available(*, deprecated, message: "Use editAttributes instead.") @objc(applyAttributeMutations:) public func apply(_ mutations: AttributeMutations)
Parameters
mutations
The mutations.
-
Enables channel creation if channelCreationDelayEnabled was set to
YES
in the config.Declaration
Swift
@objc(enableChannelCreation) public func enableChannelCreation()
-
Declaration
Swift
public func updateRegistration()