EMClientDelegate.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*!
  2. * \~chinese
  3. * @header EMClientDelegate.h
  4. * @abstract 此协议提供了一些实用工具类的回调
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMClientDelegate.h
  10. * @abstract This protocol provides a number of utility classes callback
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. /*!
  16. * \~chinese
  17. * 网络连接状态
  18. *
  19. * \~english
  20. * Network Connection Status
  21. */
  22. typedef enum {
  23. EMConnectionConnected = 0, /*! *\~chinese 已连接 *\~english Connected */
  24. EMConnectionDisconnected, /*! *\~chinese 未连接 *\~english Disconnected */
  25. } EMConnectionState;
  26. @class EMError;
  27. /*!
  28. * \~chinese
  29. * @abstract 此协议提供了一些实用工具类的回调
  30. *
  31. * \~english
  32. * @abstract This protocol provides a number of utility classes callback
  33. */
  34. @protocol EMClientDelegate <NSObject>
  35. @optional
  36. /*!
  37. * \~chinese
  38. * SDK连接服务器的状态变化时会接收到该回调
  39. *
  40. * 有以下几种情况, 会引起该方法的调用:
  41. * 1. 登录成功后, 手机无法上网时, 会调用该回调
  42. * 2. 登录成功后, 网络状态变化时, 会调用该回调
  43. *
  44. * @param aConnectionState 当前状态
  45. *
  46. * \~english
  47. * Invoked when server connection state has changed
  48. *
  49. * @param aConnectionState Current state
  50. */
  51. - (void)connectionStateDidChange:(EMConnectionState)aConnectionState;
  52. /*!
  53. * \~chinese
  54. * 自动登录完成时的回调
  55. *
  56. * @param aError 错误信息
  57. *
  58. * \~english
  59. * Invoked when auto login is completed
  60. *
  61. * @param aError Error
  62. */
  63. - (void)autoLoginDidCompleteWithError:(EMError *)aError;
  64. /*!
  65. * \~chinese
  66. * 当前登录账号在其它设备登录时会接收到此回调
  67. *
  68. * \~english
  69. * Invoked when current IM account logged into another device
  70. */
  71. - (void)userAccountDidLoginFromOtherDevice;
  72. /*!
  73. * \~chinese
  74. * 当前登录账号已经被从服务器端删除时会收到该回调
  75. *
  76. * \~english
  77. * Invoked when current IM account is removed from server
  78. */
  79. - (void)userAccountDidRemoveFromServer;
  80. /*!
  81. * \~chinese
  82. * 服务被禁用
  83. *
  84. * \~english
  85. * Delegate method will be invoked when User is forbidden
  86. */
  87. - (void)userDidForbidByServer;
  88. /*!
  89. * \~chinese
  90. * 当前登录账号被强制退出时会收到该回调,有以下原因:
  91. * 1.密码被修改;
  92. * 2.登录设备数过多;
  93. *
  94. * \~english
  95. * Delegate method will be invoked when current IM account is forced to logout with the following reasons:
  96. * 1. The password is modified
  97. * 2. Logged in too many devices
  98. */
  99. - (void)userAccountDidForcedToLogout:(EMError *)aError;
  100. #pragma mark - Deprecated methods
  101. /*!
  102. * \~chinese
  103. * SDK连接服务器的状态变化时会接收到该回调
  104. *
  105. * 有以下几种情况, 会引起该方法的调用:
  106. * 1. 登录成功后, 手机无法上网时, 会调用该回调
  107. * 2. 登录成功后, 网络状态变化时, 会调用该回调
  108. *
  109. * @param aConnectionState 当前状态
  110. *
  111. * \~english
  112. * Connection to the server status changes will receive the callback
  113. *
  114. * calling the method causes:
  115. * 1. After successful login, the phone can not access
  116. * 2. After a successful login, network status change
  117. *
  118. * @param aConnectionState Current state
  119. */
  120. - (void)didConnectionStateChanged:(EMConnectionState)aConnectionState __deprecated_msg("Use -connectionStateDidChange:");
  121. /*!
  122. * \~chinese
  123. * 自动登录完成时的回调
  124. *
  125. * @param aError 错误信息
  126. *
  127. * \~english
  128. * Callback Automatic login fails
  129. *
  130. * @param aError Error
  131. */
  132. - (void)didAutoLoginWithError:(EMError *)aError __deprecated_msg("Use -autoLoginDidCompleteWithError:");
  133. /*!
  134. * \~chinese
  135. * 当前登录账号在其它设备登录时会接收到此回调
  136. *
  137. * \~english
  138. * Will receive this callback when current account login from other device
  139. */
  140. - (void)didLoginFromOtherDevice __deprecated_msg("Use -userAccountDidLoginFromOtherDevice");
  141. /*!
  142. * \~chinese
  143. * 当前登录账号已经被从服务器端删除时会收到该回调
  144. *
  145. * \~english
  146. * Current login account will receive the callback is deleted from the server
  147. */
  148. - (void)didRemovedFromServer __deprecated_msg("Use -userAccountDidRemoveFromServer");
  149. @end