Skip to content

Instantly share code, notes, and snippets.

@rahulgautam
Forked from kcoleman731/LYRClientDelegate.h
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save rahulgautam/9779e41cfdb29c2ebcae to your computer and use it in GitHub Desktop.

Select an option

Save rahulgautam/9779e41cfdb29c2ebcae to your computer and use it in GitHub Desktop.
@protocol LYRClientDelegate <NSObject>
@optional
/**
@abstract Called when client status changes.
@param client The client calling the delegate method.
@param status The new status of the client.
@param error An `NSError` object that contains error information in case the action was not successful.
*/
- (void)layerClient:(LYRClient *)client didChangeStatus:(LYRClientStatus)status error:(NSError *)error
{
if ((status & LYRClientStatusSessionOpen) == LYRClientStatusSessionOpen) {
//Client is connected to the Layer service and ready for auth
}
if ((status & LYRClientStatusConnected) == LYRClientStatusConnected) {
//Client is authenticated with the Layer service and ready for communication
}
if ((status & LYRClientStatusSessionClosed) == LYRClientStatusSessionClosed) {
//Client is no longer authenticated, you should kick of re-auth procedures here is necessary
}
}
/**
@abstract Called when there's a progress update of the synchronization procedure
@param client The client calling the delegate method
@param tag Synchronization task tag (usefull for when you need to track the progress of each syncrhonization task)
@param progress A `float` number representing the syncrhonization task progress.
*/
- (void)layerClient:(LYRClient *)client didReceiveSyncUpdateWithTag:(NSUInteger)tag progress:(float)progress;
/**
@abstract Called when user info of the logged in user changes.
@param client The client calling the delegate method.
@param error An `NSError` object that contains error information in case the action was not successful.
*/
- (void)layerClient:(LYRClient *)client didChangeUserInfoWithError:(NSError *)error;
/**
@abstract Called when contacts changed.
@param client The client calling the delegate method.
@param error An `NSError` object that contains error information in case the action was not successful.
*/
- (void)layerClient:(LYRClient *)client didChangeContactsWithError:(NSError *)error;
/**
@abstract Called when a message has been received.
@param client The client calling the delegate method.
@param messages An array of received `LYRMessage` objects.
*/
- (void)layerClient:(LYRClient *)client didReceiveMessages:(NSArray *)messages;
/**
@abstract Called when a message has been sent.
@param client The client calling the delegate method.
@param messages An NSArray of sent `LYRMessage` objects.
*/
- (void)layerClient:(LYRClient *)client didSendMessages:(NSArray *)messages;
/**
@abstract Called when a call has been received.
@param client The client calling the delegate method.
@param call The received `LYRCall` object.
*/
- (void)layerClient:(LYRClient *)client didReceiveCall:(LYRCall *)call;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment