ARTPushDeviceRegistrationsProtocol
Objective-C
@protocol ARTPushDeviceRegistrationsProtocol
Swift
protocol ARTPushDeviceRegistrationsProtocol
The protocol upon which the ARTPushDeviceRegistrations
is implemented.
-
Registers or updates a
ARTDeviceDetails
object with Ably.Declaration
Objective-C
- (void)save:(nonnull ARTDeviceDetails *)deviceDetails callback:(nonnull ARTCallback)callback;
Swift
func save(_ deviceDetails: ARTDeviceDetails, callback: @escaping ARTCallback)
Parameters
deviceDetails
The
ARTDeviceDetails
object to create or update.callback
A success or failure callback function.
-
Retrieves the
ARTDeviceDetails
of a device registered to receive push notifications using itsdeviceId
.Declaration
Objective-C
- (void)get:(nonnull ARTDeviceId *)deviceId callback:(nonnull void (^)(ARTDeviceDetails *_Nullable, ARTErrorInfo *_Nullable))callback;
Swift
func get(_ deviceId: String, callback: @escaping (ARTDeviceDetails?, ARTErrorInfo?) -> Void)
Parameters
deviceId
The unique ID of the device.
callback
A callback for receiving the
ARTDeviceDetails
object. -
Retrieves all devices matching the filter
params
provided. Returns aARTPaginatedResult
object, containing an array ofARTDeviceDetails
objects.Declaration
Objective-C
- (void)list:(nonnull NSStringDictionary *)params callback:(nonnull ARTPaginatedDeviceDetailsCallback)callback;
Swift
func list(_ params: [String : String], callback: @escaping ARTPaginatedDeviceDetailsCallback)
Parameters
params
An object containing key-value pairs to filter devices by. Can contain
clientId
,deviceId
and alimit
on the number of devices returned, up to 1,000.callback
A callback for retriving an
ARTPaginatedResult
object with an array ofARTDeviceDetails
objects. -
Removes a device registered to receive push notifications from Ably using its
deviceId
.Declaration
Objective-C
- (void)remove:(nonnull NSString *)deviceId callback:(nonnull ARTCallback)callback;
Swift
func remove(_ deviceId: String, callback: @escaping ARTCallback)
Parameters
deviceId
The unique ID of the device.
callback
A success or failure callback function.
-
Removes all devices registered to receive push notifications from Ably matching 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 devices by. Can contain
clientId
anddeviceId
.callback
A success or failure callback function.