ARTPushDeviceRegistrationsProtocol
Objective-C
@protocol ARTPushDeviceRegistrationsProtocol
Swift
protocol ARTPushDeviceRegistrationsProtocol
The protocol upon which the ARTPushDeviceRegistrations is implemented.
-
Registers or updates a
ARTDeviceDetailsobject with Ably.Declaration
Objective-C
- (void)save:(nonnull ARTDeviceDetails *)deviceDetails callback:(nonnull ARTCallback)callback;Swift
func save(_ deviceDetails: ARTDeviceDetails, callback: @escaping ARTCallback)Parameters
deviceDetailsThe
ARTDeviceDetailsobject to create or update.callbackA success or failure callback function.
-
Retrieves the
ARTDeviceDetailsof 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
deviceIdThe unique ID of the device.
callbackA callback for receiving the
ARTDeviceDetailsobject. -
Retrieves all devices matching the filter
paramsprovided. Returns aARTPaginatedResultobject, containing an array ofARTDeviceDetailsobjects.Declaration
Objective-C
- (void)list:(nonnull NSStringDictionary *)params callback:(nonnull ARTPaginatedDeviceDetailsCallback)callback;Swift
func list(_ params: [String : String], callback: @escaping ARTPaginatedDeviceDetailsCallback)Parameters
paramsAn object containing key-value pairs to filter devices by. Can contain
clientId,deviceIdand alimiton the number of devices returned, up to 1,000.callbackA callback for retriving an
ARTPaginatedResultobject with an array ofARTDeviceDetailsobjects. -
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
deviceIdThe unique ID of the device.
callbackA success or failure callback function.
-
Removes all devices registered to receive push notifications from Ably matching the filter
paramsprovided.Declaration
Objective-C
- (void)removeWhere:(nonnull NSStringDictionary *)params callback:(nonnull ARTCallback)callback;Swift
func removeWhere(_ params: [String : String], callback: @escaping ARTCallback)Parameters
paramsAn object containing key-value pairs to filter devices by. Can contain
clientIdanddeviceId.callbackA success or failure callback function.