diff --git a/Source/ARTRealtime.m b/Source/ARTRealtime.m index aa10cf716..bb5f67742 100644 --- a/Source/ARTRealtime.m +++ b/Source/ARTRealtime.m @@ -150,6 +150,16 @@ - (void)time:(ARTDateTimeCallback)cb { [_internal time:cb]; } +- (BOOL)request:(NSString *)method + path:(NSString *)path + params:(nullable NSStringDictionary *)params + body:(nullable id)body + headers:(nullable NSStringDictionary *)headers + callback:(ARTHTTPPaginatedCallback)callback + error:(NSError *_Nullable *_Nullable)errorPtr { + return [_internal request:method path:path params:params body:body headers:headers callback:callback error:errorPtr]; +} + - (void)ping:(ARTCallback)cb { [_internal ping:cb]; } @@ -482,6 +492,16 @@ - (void)time:(ARTDateTimeCallback)cb { [self.rest time:cb]; } +- (BOOL)request:(NSString *)method + path:(NSString *)path + params:(nullable NSStringDictionary *)params + body:(nullable id)body + headers:(nullable NSStringDictionary *)headers + callback:(ARTHTTPPaginatedCallback)callback + error:(NSError *_Nullable *_Nullable)errorPtr { + return [self.rest request:method path:path params:params body:body headers:headers callback:callback error:errorPtr]; +} + - (void)ping:(ARTCallback) cb { if (cb) { ARTCallback userCallback = cb; diff --git a/Source/include/Ably/ARTRealtime.h b/Source/include/Ably/ARTRealtime.h index fbf87b8b8..4045f2089 100644 --- a/Source/include/Ably/ARTRealtime.h +++ b/Source/include/Ably/ARTRealtime.h @@ -72,6 +72,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)time:(ARTDateTimeCallback)callback; +/** + * A wrapper around `-[ARTRestProtocol request:path:params:body:headers:callback:error:]` (See [RTC9](https://sdk.ably.com/builds/ably/specification/main/features/#RTC9)). + */ +- (BOOL)request:(NSString *)method + path:(NSString *)path + params:(nullable NSStringDictionary *)params + body:(nullable id)body + headers:(nullable NSStringDictionary *)headers + callback:(ARTHTTPPaginatedCallback)callback + error:(NSError *_Nullable *_Nullable)errorPtr; + /// :nodoc: TODO: docstring - (void)ping:(ARTCallback)cb;