Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTC6 #40

Merged
merged 2 commits into from
Oct 29, 2015
Merged

RTC6 #40

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ably-ios/ARTRealtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Instance the Ably library with the given options.
- (NSString *)recoveryKey;
- (ARTAuth *)auth;
- (__GENERIC(NSDictionary, NSString *, ARTRealtimeChannel *) *)channels;
- (void)time:(void(^)(NSDate *time, NSError *error))cb;
- (void)time:(ARTTimeCallback)cb;

typedef void (^ARTRealtimePingCb)(ARTStatus *);
- (void)ping:(ARTRealtimePingCb) cb;
Expand Down
2 changes: 1 addition & 1 deletion ably-ios/ARTRest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ART_ASSUME_NONNULL_BEGIN
- (instancetype)initWithLogger:(ARTLog *)logger andOptions:(ARTClientOptions *)options;
- (instancetype)initWithKey:(NSString *)key;

- (void)time:(void(^)(NSDate *__art_nullable time, NSError *__art_nullable error))callback;
- (void)time:(ARTTimeCallback)callback;

- (void)stats:(art_nullable ARTStatsQuery *)query callback:(ARTStatsCallback)callback;

Expand Down
2 changes: 2 additions & 0 deletions ably-ios/ARTTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ typedef void (^ARTHttpRequestCallback)(NSHTTPURLResponse *__art_nullable respons

typedef void (^ARTStatsCallback)(ARTPaginatedResult *__art_nullable result, NSError *__art_nullable error);

typedef void (^ARTTimeCallback)(NSDate *__art_nullable time, NSError *__art_nullable error);

// FIXME: review
typedef void (^ARTAuthCallback)(ARTAuthTokenParams *tokenParams, void(^callback)(ARTAuthTokenRequest *__art_nullable tokenRequest, NSError *__art_nullable error));

Expand Down
15 changes: 15 additions & 0 deletions ablySpec/RealtimeClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,21 @@ class RealtimeClient: QuickSpec {
}
}
}

context("time") {
// RTC6a
it("should present an async interface") {
let client = ARTRealtime(options: AblyTests.commonAppSetup())
// Async
waitUntil(timeout: 20.0) { done in
// Proxy from `client.rest.time`
client.time({ date, error in
expect(date).toNot(beNil())
done()
})
}
}
}
}
}
}