Skip to content

Commit

Permalink
Merge pull request #23 from JoaoCaixinha/master
Browse files Browse the repository at this point in the history
Added getPublishTimeout and setPublishTimeout
  • Loading branch information
realtime-framework authored Jan 24, 2017
2 parents c562605 + e48abe6 commit a478deb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
14 changes: 12 additions & 2 deletions Pod/Classes/OrtcClient/OrtcClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@
*
* @param options The subscription options dictionary, EX: "options = {
* channel,
* subscribeOnReconnected, // optional, default = true
* withNotifications, // optional, default = false, push notifications platform as in subscribeWithNotifications
* subscribeOnReconnected, // optional, default = true,
* withNotifications (Bool), // optional, default = false, use push notifications as in subscribeWithNotifications
* filter, // optional, default = "", the subscription filter as in subscribeWithFilter
* subscriberId // optional, default = "", the subscriberId as in subscribeWithBuffer
* }".
Expand Down Expand Up @@ -384,6 +384,16 @@
*/
- (void)presence:(NSString*) aUrl isCLuster:(BOOL) aIsCluster applicationKey:(NSString*) aApplicationKey authenticationToken:(NSString*) aAuthenticationToken channel:(NSString*) channel callback:(void (^)(NSError* error, NSDictionary* result)) aCallback;

/**
* Set publish messages timeout.
*/
- (void) setPublishTimeout:(int)timeout;

/**
* Return publish messages timeout.
*/
- (int) getPublishTimeout;

/**
* Get heartbeat interval.
*/
Expand Down
14 changes: 14 additions & 0 deletions Pod/Classes/OrtcClient/OrtcClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -1044,32 +1044,46 @@ - (void)presence:(NSString*) aUrl isCLuster:(BOOL) aIsCluster applicationKey:(NS
}


- (void) setPublishTimeout:(int)timeout{
_publishTimeout = timeout;
}

- (int) getPublishTimeout{
return _publishTimeout;
}

- (int) getHeartbeatTime{
return heartbeatTime;
}

- (void) setHeartbeatTime:(int) newHeartbeatTime {
if(newHeartbeatTime > heartbeatMaxTime || newHeartbeatTime < heartbeatMinTime){
[self delegateExceptionCallback:self error:[self generateError:[NSString stringWithFormat:@"Heartbeat time is out of limits (min: %d, max: %d)", heartbeatMinTime, heartbeatMaxTime]]];
} else {
heartbeatTime = newHeartbeatTime;
}
}

- (int) getHeartbeatFails{
return heartbeatFails;
}

- (void) setHeartbeatFails:(int) newHeartbeatFails {
if(newHeartbeatFails > heartbeatMaxFails || newHeartbeatFails < heartbeatMinFails){
[self delegateExceptionCallback:self error:[self generateError:[NSString stringWithFormat:@"Heartbeat fails is out of limits (min: %d, max: %d)", heartbeatMinFails, heartbeatMaxFails]]];
} else {
heartbeatFails = newHeartbeatFails;
}
}

- (BOOL) isHeartbeatActive{
return heartbeatActive;
}

- (void) enableHeartbeat{
heartbeatActive = true;
}

- (void) disableHeartbeat{
heartbeatActive = false;
}
Expand Down
2 changes: 1 addition & 1 deletion RealtimeMessaging-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "RealtimeMessaging-iOS"
s.version = "2.1.42"
s.version = "2.1.44"
s.summary = "Realtime Cloud Messaging (ORTC) SDK for iOS"
s.description = <<-DESC
Part of the The Realtime® Framework, Realtime Cloud Messaging (aka ORTC) is a secure, fast and highly scalable cloud-hosted Pub/Sub real-time message broker for web and mobile apps.
Expand Down

0 comments on commit a478deb

Please sign in to comment.