Skip to content

Instantly share code, notes, and snippets.

@kcoleman731
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save kcoleman731/257437edf71c7774e76c to your computer and use it in GitHub Desktop.

Select an option

Save kcoleman731/257437edf71c7774e76c 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 ((state & LYRClientStatusSessionOpen) == LYRClientStatusSessionOpen) {
//Client is connected to the Layer service and ready for auth
}
if ((state & LYRClientStatusConnected) == LYRClientStatusConnected) {
//Client is authenticated with the Layer service and ready for communication
}
if ((state & 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
@rahulgautam
Copy link
Copy Markdown

Hi Kevin,

Thanks for that

For this
if ((state & LYRClientStatusSessionOpen) == LYRClientStatusSessionOpen) {

you mean
if ((status & LYRClientStatusSessionOpen) == LYRClientStatusSessionOpen) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment