Skip to content

Commit

Permalink
ARTRest.internetIsUp: s/bool/BOOL/
Browse files Browse the repository at this point in the history
  • Loading branch information
tcard committed May 16, 2016
1 parent 40bc2ee commit 6958f7a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ PODS:
- msgpack (0.1.8)
- Nimble (4.0.0)
- Quick (0.9.1)
- SocketRocket (0.5.0)
- SocketRocket (0.5.1)
- SwiftyJSON (2.3.1)

DEPENDENCIES:
- Aspects
- msgpack (= 0.1.8)
- Nimble (= 4.0.0)
- Quick (= 0.9.1)
- SocketRocket (= 0.5.0)
- SocketRocket (= 0.5.1)
- SwiftyJSON (= 2.3.1)

SPEC CHECKSUMS:
Aspects: 7595ba96a6727a58ebcbfc954497fc5d2fdde546
msgpack: 97491d2ea799408f4694f2c7d7fd79baf77853dd
Nimble: 72bcc3e2f02242e6bfaaf8d9412ca7bfe3d8b417
Quick: a5221fc21788b6aeda934805e68b061839bc3165
SocketRocket: 2c51efccd2d73c99a923407ca4b06e7e9da95dbf
SocketRocket: d57c7159b83c3c6655745cd15302aa24b6bae531
SwiftyJSON: 592b53bee5ef3dd9b3bebc6b9cb7ee35426ae8c3

COCOAPODS: 0.39.0
2 changes: 1 addition & 1 deletion Source/ARTRealtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ - (void)realtimeTransportFailed:(id<ARTRealtimeTransport>)transport withError:(A
if ([self shouldRetryWithFallback:error]) {
[self.logger debug:__FILE__ line:__LINE__ message:@"R:%p host is down; can retry with fallback host", self];
if (!_fallbacks && [error.url.host isEqualToString:[ARTDefault realtimeHost]]) {
[self.rest internetIsUp:^(BOOL isUp) {
[self.rest internetIsUp:^void(BOOL isUp) {
_fallbacks = [[ARTFallback alloc] init];
[self reconnectWithFallback];
}];
Expand Down
2 changes: 1 addition & 1 deletion Source/ARTRest+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ART_ASSUME_NONNULL_BEGIN

- (void)prepareAuthorisationHeader:(ARTAuthMethod)method completion:(void (^)(NSString *__art_nonnull authorization, NSError *__art_nullable error))callback;

- (id<ARTCancellable>)internetIsUp:(void (^)(bool isUp))cb;
- (id<ARTCancellable>)internetIsUp:(void (^)(BOOL isUp))cb;

@end

Expand Down
4 changes: 2 additions & 2 deletions Source/ARTRest.m
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ - (void)time:(void(^)(NSDate *time, NSError *error))callback {
}];
}

- (id<ARTCancellable>)internetIsUp:(void (^)(bool isUp)) cb {
- (id<ARTCancellable>)internetIsUp:(void (^)(BOOL isUp)) cb {
NSURL *requestUrl = [NSURL URLWithString:@"http://internet-up.ably-realtime.com/is-the-internet-up.txt"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestUrl];
request.HTTPMethod = @"GET";

[self executeRequest:request withAuthOption:ARTAuthenticationOff completion:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
if (error) {
cb(false);
cb(NO);
return;
}
NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
Expand Down
2 changes: 1 addition & 1 deletion Tests/ARTRestInitTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (void)testInternetIsUp {
ARTClientOptions *options = [ARTTestUtil newSandboxApp:self withDescription:__FUNCTION__];
__weak XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __FUNCTION__]];
ARTRest *rest = [[ARTRest alloc] initWithOptions:options];
[rest internetIsUp:^(bool isUp) {
[rest internetIsUp:^(BOOL isUp) {
XCTAssertTrue(isUp);
[expectation fulfill];
}];
Expand Down

0 comments on commit 6958f7a

Please sign in to comment.