-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip introduce proxy realtime presence class
no functionality here
- Loading branch information
1 parent
fa17140
commit 7cf48a3
Showing
9 changed files
with
185 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#import "ARTWrapperSDKProxyRealtimePresence+Private.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface ARTWrapperSDKProxyRealtimePresence () | ||
|
||
@property (nonatomic, readonly) ARTRealtimePresence *underlyingRealtimePresence; | ||
@property (nonatomic, readonly) ARTWrapperSDKProxyOptions *proxyOptions; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
|
||
@implementation ARTWrapperSDKProxyRealtimePresence | ||
|
||
- (instancetype)initWithRealtimePresence:(ARTRealtimePresence *)push proxyOptions:(ARTWrapperSDKProxyOptions *)proxyOptions { | ||
if (self = [super init]) { | ||
_underlyingRealtimePresence = push; | ||
_proxyOptions = proxyOptions; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (BOOL)syncComplete { | ||
return self.underlyingRealtimePresence.syncComplete; | ||
} | ||
|
||
- (void)enter:(id _Nullable)data { | ||
[self.underlyingRealtimePresence enter:data]; | ||
} | ||
|
||
- (void)enter:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence enter:data callback:callback]; | ||
} | ||
|
||
- (void)enterClient:(nonnull NSString *)clientId data:(id _Nullable)data { | ||
[self.underlyingRealtimePresence enterClient:clientId data:data]; | ||
} | ||
|
||
- (void)enterClient:(nonnull NSString *)clientId data:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence enterClient:clientId data:data callback:callback]; | ||
} | ||
|
||
- (void)get:(nonnull ARTPresenceMessagesCallback)callback { | ||
[self.underlyingRealtimePresence get:callback]; | ||
} | ||
|
||
- (void)get:(nonnull ARTRealtimePresenceQuery *)query callback:(nonnull ARTPresenceMessagesCallback)callback { | ||
[self.underlyingRealtimePresence get:query callback:callback]; | ||
} | ||
|
||
- (void)history:(nonnull ARTPaginatedPresenceCallback)callback { | ||
[self.underlyingRealtimePresence history:callback]; | ||
} | ||
|
||
- (BOOL)history:(ARTRealtimeHistoryQuery * _Nullable)query callback:(nonnull ARTPaginatedPresenceCallback)callback error:(NSError * _Nullable __autoreleasing * _Nullable)errorPtr { | ||
return [self.underlyingRealtimePresence history:query callback:callback error:errorPtr]; | ||
} | ||
|
||
- (void)leave:(id _Nullable)data { | ||
[self.underlyingRealtimePresence leave:data]; | ||
} | ||
|
||
- (void)leave:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence leave:data callback:callback]; | ||
} | ||
|
||
- (void)leaveClient:(nonnull NSString *)clientId data:(id _Nullable)data { | ||
[self.underlyingRealtimePresence leaveClient:clientId data:data]; | ||
} | ||
|
||
- (void)leaveClient:(nonnull NSString *)clientId data:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence leaveClient:clientId data:data callback:callback]; | ||
} | ||
|
||
- (ARTEventListener * _Nullable)subscribe:(nonnull ARTPresenceMessageCallback)callback { | ||
return [self.underlyingRealtimePresence subscribe:callback]; | ||
} | ||
|
||
- (ARTEventListener * _Nullable)subscribe:(ARTPresenceAction)action callback:(nonnull ARTPresenceMessageCallback)callback { | ||
return [self.underlyingRealtimePresence subscribe:action callback:callback]; | ||
} | ||
|
||
- (ARTEventListener * _Nullable)subscribe:(ARTPresenceAction)action onAttach:(nullable ARTCallback)onAttach callback:(nonnull ARTPresenceMessageCallback)callback { | ||
return [self.underlyingRealtimePresence subscribe:action onAttach:onAttach callback:callback]; | ||
} | ||
|
||
- (ARTEventListener * _Nullable)subscribeWithAttachCallback:(nullable ARTCallback)onAttach callback:(nonnull ARTPresenceMessageCallback)callback { | ||
return [self.underlyingRealtimePresence subscribeWithAttachCallback:onAttach callback:callback]; | ||
} | ||
|
||
- (void)unsubscribe { | ||
[self.underlyingRealtimePresence unsubscribe]; | ||
} | ||
|
||
- (void)unsubscribe:(nonnull ARTEventListener *)listener { | ||
[self.underlyingRealtimePresence unsubscribe:listener]; | ||
} | ||
|
||
- (void)unsubscribe:(ARTPresenceAction)action listener:(nonnull ARTEventListener *)listener { | ||
[self.underlyingRealtimePresence unsubscribe:action listener:listener]; | ||
} | ||
|
||
- (void)update:(id _Nullable)data { | ||
[self.underlyingRealtimePresence update:data]; | ||
} | ||
|
||
- (void)update:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence update:data callback:callback]; | ||
} | ||
|
||
- (void)updateClient:(nonnull NSString *)clientId data:(id _Nullable)data { | ||
[self.underlyingRealtimePresence updateClient:clientId data:data]; | ||
} | ||
|
||
- (void)updateClient:(nonnull NSString *)clientId data:(id _Nullable)data callback:(nullable ARTCallback)callback { | ||
[self.underlyingRealtimePresence updateClient:clientId data:data callback:callback]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Source/PrivateHeaders/Ably/ARTWrapperSDKProxyRealtimePresence+Private.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#import <Ably/ARTWrapperSDKProxyRealtimePresence.h> | ||
|
||
@class ARTWrapperSDKProxyOptions; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface ARTWrapperSDKProxyRealtimePresence () | ||
|
||
- (instancetype)initWithRealtimePresence:(ARTRealtimePresence *)realtimePresence | ||
proxyOptions:(ARTWrapperSDKProxyOptions *)proxyOptions NS_DESIGNATED_INITIALIZER; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <Ably/ARTRealtimePresence.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
* An object which wraps an instance of `ARTRealtimePresence` and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK. | ||
* | ||
* - Important: This class should only be used by Ably-authored SDKs. | ||
*/ | ||
NS_SWIFT_SENDABLE | ||
@interface ARTWrapperSDKProxyRealtimePresence : NSObject <ARTRealtimePresenceProtocol> | ||
|
||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters