Nav apraksta

EMClientDelegate.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 Not connected */
  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. * Delegate method will be 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. * Delegate method will be 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. * Delegate method will be invoked when current IM account logged into another device
  70. */
  71. - (void)userAccountDidLoginFromOtherDevice;
  72. /*!
  73. * \~chinese
  74. * 当前登录账号已经被从服务器端删除时会收到该回调
  75. *
  76. * \~english
  77. * Delegate method will be invoked when current IM account is removed from server
  78. */
  79. - (void)userAccountDidRemoveFromServer;
  80. /*!
  81. * \~chinese
  82. * 服务被禁用
  83. *
  84. * \~english
  85. * User is forbidden
  86. */
  87. - (void)userDidForbidByServer;
  88. #pragma mark - Deprecated methods
  89. /*!
  90. * \~chinese
  91. * SDK连接服务器的状态变化时会接收到该回调
  92. *
  93. * 有以下几种情况, 会引起该方法的调用:
  94. * 1. 登录成功后, 手机无法上网时, 会调用该回调
  95. * 2. 登录成功后, 网络状态变化时, 会调用该回调
  96. *
  97. * @param aConnectionState 当前状态
  98. *
  99. * \~english
  100. * Connection to the server status changes will receive the callback
  101. *
  102. * calling the method causes:
  103. * 1. After successful login, the phone can not access
  104. * 2. After a successful login, network status change
  105. *
  106. * @param aConnectionState Current state
  107. */
  108. - (void)didConnectionStateChanged:(EMConnectionState)aConnectionState __deprecated_msg("Use -connectionStateDidChange:");
  109. /*!
  110. * \~chinese
  111. * 自动登录完成时的回调
  112. *
  113. * @param aError 错误信息
  114. *
  115. * \~english
  116. * Callback Automatic login fails
  117. *
  118. * @param aError Error
  119. */
  120. - (void)didAutoLoginWithError:(EMError *)aError __deprecated_msg("Use -autoLoginDidCompleteWithError:");
  121. /*!
  122. * \~chinese
  123. * 当前登录账号在其它设备登录时会接收到此回调
  124. *
  125. * \~english
  126. * Will receive this callback when current account login from other device
  127. */
  128. - (void)didLoginFromOtherDevice __deprecated_msg("Use -userAccountDidLoginFromOtherDevice");
  129. /*!
  130. * \~chinese
  131. * 当前登录账号已经被从服务器端删除时会收到该回调
  132. *
  133. * \~english
  134. * Current login account will receive the callback is deleted from the server
  135. */
  136. - (void)didRemovedFromServer __deprecated_msg("Use -userAccountDidRemoveFromServer");
  137. @end