ARTPushChannelSubscriptionsProtocol

Objective-C

@protocol ARTPushChannelSubscriptionsProtocol

Swift

protocol ARTPushChannelSubscriptionsProtocol

The protocol upon which the ARTPushChannelSubscriptions is implemented.

  • Subscribes a device, or a group of devices sharing the same clientId to push notifications on a channel.

    Declaration

    Objective-C

    - (void)save:(nonnull ARTPushChannelSubscription *)channelSubscription
        callback:(nonnull ARTCallback)callback;

    Swift

    func save(_ channelSubscription: ARTPushChannelSubscription, callback: @escaping ARTCallback)

    Parameters

    channelSubscription
    callback

    A success or failure callback function.

  • Retrieves all channels with at least one device subscribed to push notifications. Returns a ARTPaginatedResult object, containing an array of channel names.

    Declaration

    Objective-C

    - (void)listChannels:(nonnull ARTPaginatedTextCallback)callback;

    Swift

    func listChannels(_ callback: @escaping ARTPaginatedTextCallback)

    Parameters

    callback

    A callback for retriving an ARTPaginatedResult object with an array of channel names.

  • Retrieves all push channel subscriptions matching the filter params provided. Returns a ARTPaginatedResult object, containing an array of ARTPushChannelSubscription objects.

    Declaration

    Objective-C

    - (void)list:(nonnull NSStringDictionary *)params
        callback:(nonnull ARTPaginatedPushChannelCallback)callback;

    Swift

    func list(_ params: [String : String], callback: @escaping ARTPaginatedPushChannelCallback)

    Parameters

    params

    An object containing key-value pairs to filter subscriptions by. Can contain channel, clientId, deviceId and a limit on the number of devices returned, up to 1,000.

    callback

    A callback for retriving an ARTPaginatedResult object with an array of ARTPushChannelSubscription objects.

  • Unsubscribes a device, or a group of devices sharing the same clientId from receiving push notifications on a channel.

    Declaration

    Objective-C

    - (void)remove:(nonnull ARTPushChannelSubscription *)subscription
          callback:(nonnull ARTCallback)callback;

    Swift

    func remove(_ subscription: ARTPushChannelSubscription, callback: @escaping ARTCallback)

    Parameters

    subscription
    callback

    A success or failure callback function.

  • Unsubscribes all devices from receiving push notifications on a channel that match the filter params provided.

    Declaration

    Objective-C

    - (void)removeWhere:(nonnull NSStringDictionary *)params
               callback:(nonnull ARTCallback)callback;

    Swift

    func removeWhere(_ params: [String : String], callback: @escaping ARTCallback)

    Parameters

    params

    An object containing key-value pairs to filter subscriptions by. Can contain channel, and optionally either clientId or deviceId.

    callback

    A success or failure callback function.