Skip to content

Commit

Permalink
Rearrange types relationships to avoid ambiguities.
Browse files Browse the repository at this point in the history
Previously, we had some situations in which, for convenience, we were
inheriting rather than composing (RealtimeChannel inheriting from
RestChannel). This was causing problems in places where some parent
class implemented `method:(A)a` while a child class was implementing
`method:(B)b`. Swift 2.2 doesn't let you do this, so it's necessary for
that, but it's also a good idea for Swift <2.2 if only for code
organization and soundness.

Also added some changes in the test Swift code for forwards
compatibility.
  • Loading branch information
tcard committed Apr 8, 2016
1 parent 7545f58 commit 624c866
Show file tree
Hide file tree
Showing 26 changed files with 267 additions and 191 deletions.
10 changes: 8 additions & 2 deletions Ably.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@
D7CEF12D1C8D821D004FB242 /* ARTRealtimeChannels+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D7CEF12C1C8D821D004FB242 /* ARTRealtimeChannels+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
D7CEF1321C8DD3BC004FB242 /* RealtimeClientPresence.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7CEF1311C8DD3BC004FB242 /* RealtimeClientPresence.swift */; };
D7D29B421BE3DEB300374295 /* ARTConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = D7D29B411BE3DEB300374295 /* ARTConnection.m */; };
D7D5A69C1CA40C350071BD6D /* ARTConnectionDetails+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D7D5A69B1CA40C350071BD6D /* ARTConnectionDetails+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
D7D5A69A1CA3D9040071BD6D /* ARTAuthOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D7D5A6991CA3D9040071BD6D /* ARTAuthOptions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
D7D5A69C1CA40C350071BD6D /* ARTConnectionDetails+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D7D5A69B1CA40C350071BD6D /* ARTConnectionDetails+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
D7D8F8211BC2BE16009718F2 /* ARTAuthOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = D7D8F81F1BC2BE15009718F2 /* ARTAuthOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
D7D8F8221BC2BE16009718F2 /* ARTAuthOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = D7D8F8201BC2BE15009718F2 /* ARTAuthOptions.m */; };
D7D8F8251BC2C691009718F2 /* ARTTokenDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = D7D8F8231BC2C691009718F2 /* ARTTokenDetails.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -160,6 +160,7 @@
EB503C881C7E4A090053AF00 /* ARTClientOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EB503C871C7E4A090053AF00 /* ARTClientOptions+Private.h */; settings = {ATTRIBUTES = (Public, ); }; };
EB503C8A1C7F1FE40053AF00 /* ARTLog+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EB503C891C7F1FE40053AF00 /* ARTLog+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
EB5E058D1C77027600A48B39 /* ARTCrypto+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EB5E058C1C77027600A48B39 /* ARTCrypto+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
EB7617721CB6CBFF00D0981E /* ARTRealtimePresence+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = EB7617711CB6CBFE00D0981E /* ARTRealtimePresence+Private.h */; };
EB7913A81C6E54C3000ABF9B /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7913A71C6E54C3000ABF9B /* Crypto.swift */; };
EB82F8511C59D29B00661917 /* ARTDataEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB3239461C59AB2C00892664 /* ARTDataEncoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
EB82F8521C59D30500661917 /* ARTDataEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = EB3239421C59AB0400892664 /* ARTDataEncoder.m */; };
Expand Down Expand Up @@ -357,8 +358,8 @@
D7CEF1311C8DD3BC004FB242 /* RealtimeClientPresence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealtimeClientPresence.swift; sourceTree = "<group>"; };
D7D29B401BE3DD0600374295 /* ARTConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ARTConnection.h; sourceTree = "<group>"; };
D7D29B411BE3DEB300374295 /* ARTConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTConnection.m; sourceTree = "<group>"; };
D7D5A69B1CA40C350071BD6D /* ARTConnectionDetails+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTConnectionDetails+Private.h"; sourceTree = "<group>"; };
D7D5A6991CA3D9040071BD6D /* ARTAuthOptions+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTAuthOptions+Private.h"; sourceTree = "<group>"; };
D7D5A69B1CA40C350071BD6D /* ARTConnectionDetails+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTConnectionDetails+Private.h"; sourceTree = "<group>"; };
D7D8F81F1BC2BE15009718F2 /* ARTAuthOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTAuthOptions.h; sourceTree = "<group>"; };
D7D8F8201BC2BE15009718F2 /* ARTAuthOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTAuthOptions.m; sourceTree = "<group>"; };
D7D8F8231BC2C691009718F2 /* ARTTokenDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTTokenDetails.h; sourceTree = "<group>"; };
Expand All @@ -383,6 +384,8 @@
EB503C871C7E4A090053AF00 /* ARTClientOptions+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTClientOptions+Private.h"; sourceTree = "<group>"; };
EB503C891C7F1FE40053AF00 /* ARTLog+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTLog+Private.h"; sourceTree = "<group>"; };
EB5E058C1C77027600A48B39 /* ARTCrypto+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTCrypto+Private.h"; sourceTree = "<group>"; };
EB7617701CB6C18C00D0981E /* ARTRestPresence+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ARTRestPresence+Private.h"; sourceTree = "<group>"; };
EB7617711CB6CBFE00D0981E /* ARTRealtimePresence+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ARTRealtimePresence+Private.h"; sourceTree = "<group>"; };
EB7913A71C6E54C3000ABF9B /* Crypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Crypto.swift; sourceTree = "<group>"; };
EB89D4021C61C1A4007FA5B7 /* ARTRestChannels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARTRestChannels.h; sourceTree = "<group>"; };
EB89D4031C61C1A4007FA5B7 /* ARTRestChannels.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARTRestChannels.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -586,6 +589,7 @@
D7C1B8781BBF5F460087B55F /* ARTAuth+Private.h */,
96BF616F1A35FB7C004CF2B3 /* ARTAuth.m */,
D7F1D3711BF4DE07001A4B5E /* ARTRestPresence.h */,
EB7617701CB6C18C00D0981E /* ARTRestPresence+Private.h */,
D7F1D3721BF4DE07001A4B5E /* ARTRestPresence.m */,
EB89D4021C61C1A4007FA5B7 /* ARTRestChannels.h */,
EB89D4031C61C1A4007FA5B7 /* ARTRestChannels.m */,
Expand All @@ -608,6 +612,7 @@
D7D5A69B1CA40C350071BD6D /* ARTConnectionDetails+Private.h */,
D7B17EE21C07208B00A6958E /* ARTConnectionDetails.m */,
D7F1D3751BF4DE72001A4B5E /* ARTRealtimePresence.h */,
EB7617711CB6CBFE00D0981E /* ARTRealtimePresence+Private.h */,
D7F1D3761BF4DE72001A4B5E /* ARTRealtimePresence.m */,
D746AE321BBC29EB003ECEF8 /* Transport */,
D746AE451BBD6FE9003ECEF8 /* ARTQueuedMessage.h */,
Expand Down Expand Up @@ -783,6 +788,7 @@
EB20F8D71C653F2300EF3978 /* ARTPresence+Private.h in Headers */,
D7F1D3771BF4DE72001A4B5E /* ARTRealtimePresence.h in Headers */,
1C578E1F1B3435CA00EF46EC /* ARTFallback.h in Headers */,
EB7617721CB6CBFF00D0981E /* ARTRealtimePresence+Private.h in Headers */,
D7D5A69C1CA40C350071BD6D /* ARTConnectionDetails+Private.h in Headers */,
96E408471A3895E800087F77 /* ARTWebSocketTransport.h in Headers */,
EB503C8A1C7F1FE40053AF00 /* ARTLog+Private.h in Headers */,
Expand Down
1 change: 0 additions & 1 deletion Source/ARTChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ ART_ASSUME_NONNULL_BEGIN
- (void)publish:(__GENERIC(NSArray, ARTMessage *) *)messages callback:(art_nullable void (^)(ARTErrorInfo *__art_nullable error))callback;

- (void)history:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (BOOL)history:(art_nullable ARTDataQuery *)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;

@end

Expand Down
5 changes: 0 additions & 5 deletions Source/ARTChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ - (ARTMessage *)encodeMessageIfNeeded:(ARTMessage *)message {
}

- (void)history:(void (^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *, ARTErrorInfo *))callback {
[self history:[[ARTDataQuery alloc] init] callback:callback error:nil];
}

- (BOOL)history:(ARTDataQuery *)query callback:(void (^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *, ARTErrorInfo *))callback error:(NSError **)errorPtr {
NSAssert(false, @"-[%@ %@] should always be overriden.", self.class, NSStringFromSelector(_cmd));
return NO;
}

- (void)internalPostMessages:(id)data callback:(void (^)(ARTErrorInfo *__art_nullable error))callback {
Expand Down
1 change: 1 addition & 0 deletions Source/ARTClientOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ - (id)copyWithZone:(NSZone *)zone {
options.environment = self.environment;
options.tls = self.tls;
options.logLevel = self.logLevel;
options.logHandler = self.logHandler;
options.suspendedRetryTimeout = self.suspendedRetryTimeout;
options.disconnectedRetryTimeout = self.disconnectedRetryTimeout;
options.httpMaxRetryCount = self.httpMaxRetryCount;
Expand Down
1 change: 1 addition & 0 deletions Source/ARTPresence+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define ARTPresence_Private_h

#import "ARTPresence.h"
#import "ARTChannel.h"

@interface ARTPresenceQuery ()

Expand Down
24 changes: 1 addition & 23 deletions Source/ARTPresence.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,13 @@
#import <Foundation/Foundation.h>
#import "ARTTypes.h"
#import "ARTPresenceMessage.h"

@class ARTChannel;
@class __GENERIC(ARTPaginatedResult, ItemType);
@class ARTDataQuery;
#import "ARTPaginatedResult.h"

ART_ASSUME_NONNULL_BEGIN

@interface ARTPresenceQuery : NSObject

@property (nonatomic, readwrite) NSUInteger limit;
@property (nonatomic, strong, readwrite) NSString *clientId;
@property (nonatomic, strong, readwrite) NSString *connectionId;

- (instancetype)init;
- (instancetype)initWithClientId:(NSString *__art_nullable)clientId connectionId:(NSString *__art_nullable)connectionId;
- (instancetype)initWithLimit:(NSUInteger)limit clientId:(NSString *__art_nullable)clientId connectionId:(NSString *__art_nullable)connectionId;

@end

/// A class that provides access to presence operations and state for the associated Channel.
@interface ARTPresence : NSObject

/// Get the presence state for one channel.
- (void)get:(void (^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (BOOL)get:(ARTPresenceQuery *)query callback:(void (^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;

/// Obtain recent presence history for one channel.
- (void)history:(void(^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (BOOL)history:(art_nullable ARTDataQuery *)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;

@end

Expand Down
72 changes: 0 additions & 72 deletions Source/ARTPresence.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,82 +8,10 @@

#import "ARTPresence.h"

#import "ARTChannel.h"
#import "ARTDataQuery.h"

@implementation ARTPresenceQuery

- (instancetype)init {
return [self initWithClientId:nil connectionId:nil];
}

- (instancetype)initWithClientId:(NSString *)clientId connectionId:(NSString *)connectionId {
return [self initWithLimit:100 clientId:clientId connectionId:connectionId];
}

- (instancetype)initWithLimit:(NSUInteger)limit clientId:(NSString *)clientId connectionId:(NSString *)connectionId {
self = [super init];
if (self) {
_limit = limit;
_clientId = clientId;
_connectionId = connectionId;
}
return self;
}

- (NSMutableArray *)asQueryItems {
NSMutableArray *items = [NSMutableArray array];

if (self.clientId) {
[items addObject:[NSURLQueryItem queryItemWithName:@"clientId" value:self.clientId]];
}
if (self.connectionId) {
[items addObject:[NSURLQueryItem queryItemWithName:@"connectionId" value:self.connectionId]];
}

[items addObject:[NSURLQueryItem queryItemWithName:@"limit" value:[NSString stringWithFormat:@"%lu", (unsigned long)self.limit]]];

return items;
}

@end

@interface ARTPresence () {
__weak ARTChannel *_channel;
}

@end

@implementation ARTPresence

- (instancetype) initWithChannel:(ARTChannel *) channel {
if (self = [super init]) {
_channel = channel;
}
return self;
}

- (ARTChannel *)getChannel {
return _channel;
}


- (void)get:(void (^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *result, ARTErrorInfo *error))callback {
[self get:[[ARTPresenceQuery alloc] init] callback:callback error:nil];
}

- (BOOL)get:(ARTPresenceQuery *)query callback:(void (^)(ARTPaginatedResult<ARTPresenceMessage *> * _Nullable, ARTErrorInfo * _Nullable))callback error:(NSError **)errorPtr {
NSAssert(false, @"-[%@ %@] should always be overriden.", self.class, NSStringFromSelector(_cmd));
return false;
}

- (void)history:(void (^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *, ARTErrorInfo *))callback {
[self history:[[ARTDataQuery alloc] init] callback:callback error:nil];
}

- (BOOL)history:(ARTDataQuery *)query callback:(void (^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *, ARTErrorInfo *))callback error:(NSError **)errorPtr {
NSAssert(false, @"-[%@ %@] should always be overriden.", self.class, NSStringFromSelector(_cmd));
return NO;
}

@end
2 changes: 2 additions & 0 deletions Source/ARTRealtimeChannel+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Copyright (c) 2015 Ably. All rights reserved.
//

#import "ARTRestChannel.h"
#import "ARTRealtimeChannel.h"
#import "ARTEventEmitter.h"

Expand All @@ -18,6 +19,7 @@ ART_ASSUME_NONNULL_BEGIN
@interface ARTRealtimeChannel ()

@property (readonly, weak, nonatomic) ARTRealtime *realtime;
@property (readonly, strong, nonatomic) ARTRestChannel *restChannel;
@property (readwrite, strong, nonatomic) NSMutableArray *queuedMessages;
@property (readwrite, strong, nonatomic, art_nullable) NSString *attachSerial;
@property (readonly, getter=getClientId) NSString *clientId;
Expand Down
7 changes: 4 additions & 3 deletions Source/ARTRealtimeChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

ART_ASSUME_NONNULL_BEGIN

@interface ARTRealtimeChannel : ARTRestChannel
@class ARTRealtimePresence;

@interface ARTRealtimeChannel : ARTChannel

@property (readwrite, assign, nonatomic) ARTRealtimeChannelState state;
@property (readonly, strong, nonatomic, art_nullable) ARTErrorInfo *errorReason;
Expand All @@ -38,8 +40,7 @@ ART_ASSUME_NONNULL_BEGIN
- (void)unsubscribe:(__GENERIC(ARTEventListener, ARTMessage *) *__art_nullable)listener;
- (void)unsubscribe:(NSString *)name listener:(__GENERIC(ARTEventListener, ARTMessage *) *__art_nullable)listener;

- (void)history:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (BOOL)history:(art_nullable ARTRealtimeHistoryQuery *)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;
- (BOOL)history:(ARTRealtimeHistoryQuery *__art_nullable)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;

ART_EMBED_INTERFACE_EVENT_EMITTER(ARTChannelEvent, ARTErrorInfo *)

Expand Down
10 changes: 6 additions & 4 deletions Source/ARTRealtimeChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import "ARTMessage.h"
#import "ARTBaseMessage+Private.h"
#import "ARTAuth.h"
#import "ARTRealtimePresence.h"
#import "ARTRealtimePresence+Private.h"
#import "ARTChannel.h"
#import "ARTChannelOptions.h"
#import "ARTProtocolMessage.h"
Expand All @@ -24,6 +24,7 @@
#import "ARTNSArray+ARTFunctional.h"
#import "ARTStatus.h"
#import "ARTDefault.h"
#import "ARTRest.h"
#import "ARTClientOptions.h"

@interface ARTRealtimeChannel () {
Expand All @@ -39,9 +40,10 @@ @interface ARTRealtimeChannel () {
@implementation ARTRealtimeChannel

- (instancetype)initWithRealtime:(ARTRealtime *)realtime andName:(NSString *)name withOptions:(ARTChannelOptions *)options {
self = [super initWithName:name withOptions:options andRest:realtime.rest];
self = [super initWithName:name andOptions:options andLogger:realtime.options.logHandler];
if (self) {
_realtime = realtime;
_restChannel = [_realtime.rest.channels get:self.name options:options];
_state = ARTRealtimeChannelInitialized;
_queuedMessages = [NSMutableArray array];
_attachSerial = nil;
Expand Down Expand Up @@ -645,13 +647,13 @@ - (void)history:(void (^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *, ARTErro
- (BOOL)history:(ARTRealtimeHistoryQuery *)query callback:(void (^)(__GENERIC(ARTPaginatedResult, ARTMessage *) *, ARTErrorInfo *))callback error:(NSError **)errorPtr {
query.realtimeChannel = self;
@try {
return [super history:query callback:callback error:errorPtr];
return [_restChannel history:query callback:callback error:errorPtr];
}
@catch (NSError *error) {
if (errorPtr) {
*errorPtr = error;
}
return false;
return NO;
}
}

Expand Down
20 changes: 20 additions & 0 deletions Source/ARTRealtimePresence+Private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ARTRealtimePresence+Private.h
// ably
//
// Created by Toni Cárdenas on 7/4/16.
// Copyright © 2016 Ably. All rights reserved.
//

#ifndef ARTRealtimePresence_Private_h
#define ARTRealtimePresence_Private_h

#import "ARTRealtimePresence.h"

@interface ARTRealtimePresence ()

- (instancetype)initWithChannel:(ARTRealtimeChannel *)channel;

@end

#endif /* ARTRealtimePresence_Private_h */
9 changes: 3 additions & 6 deletions Source/ARTRealtimePresence.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#import "ARTRestPresence.h"
#import "ARTDataQuery.h"
#import "ARTEventEmitter.h"

@class ARTRealtimeChannel;
#import "ARTRealtimeChannel.h"

ART_ASSUME_NONNULL_BEGIN

Expand All @@ -21,12 +20,10 @@ ART_ASSUME_NONNULL_BEGIN

@end

@interface ARTRealtimePresence : ARTRestPresence
@interface ARTRealtimePresence : ARTPresence

@property (readonly, getter=getSyncComplete) BOOL syncComplete;

- (instancetype)initWithChannel:(ARTRealtimeChannel *)channel;

- (void)get:(void (^)(__GENERIC(NSArray, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (void)get:(ARTRealtimePresenceQuery *)query callback:(void (^)(__GENERIC(NSArray, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;

Expand Down Expand Up @@ -58,7 +55,7 @@ ART_ASSUME_NONNULL_BEGIN
- (void)unsubscribe:(ARTPresenceAction)action listener:(__GENERIC(ARTEventListener, ARTPresenceMessage *) *)listener;

- (void)history:(void(^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback;
- (BOOL)history:(art_nullable ARTRealtimeHistoryQuery *)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;
- (BOOL)history:(ARTRealtimeHistoryQuery *__art_nullable)query callback:(void(^)(__GENERIC(ARTPaginatedResult, ARTPresenceMessage *) *__art_nullable result, ARTErrorInfo *__art_nullable error))callback error:(NSError *__art_nullable *__art_nullable)errorPtr;

@end

Expand Down
Loading

0 comments on commit 624c866

Please sign in to comment.