hyphenate_SDK3.0
3.6.2
hyphenatejavaIMSDK
|
Classes | |
interface | AppStateListener |
interface | CheckResultListener |
class | MyConnectionListener |
class | MyMultiDeviceListener |
Public Member Functions | |
void | init (Context context, EMOptions options) |
void | createAccount (String username, String password) throws HyphenateException |
void | login (String id, String password, final EMCallBack callback) throws IllegalArgumentException |
void | loginWithToken (String username, String token, final EMCallBack callback) |
int | logout (boolean unbindToken) |
void | logout (final boolean unbindToken, final EMCallBack callback) |
void | changeAppkey (String appkey) throws HyphenateException |
void | addConnectionListener (final EMConnectionListener listener) |
void | addClientListener (final EMClientListener listener) |
void | removeClientListener (final EMClientListener listener) |
void | removeConnectionListener (final EMConnectionListener listener) |
EMGroupManager | groupManager () |
EMPushManager | pushManager () |
EMChatRoomManager | chatroomManager () |
EMChatManager | chatManager () |
EMContactManager | contactManager () |
EMCallManager | callManager () |
EMConferenceManager | conferenceManager () |
Context | getContext () |
String | getCurrentUser () |
void | getUserTokenFromServer (final String username, final String password, final EMValueCallBack< String > callBack) |
boolean | isLoggedInBefore () |
boolean | isConnected () |
void | setDebugMode (boolean debugMode) |
boolean | updateCurrentUserNick (String nickname) |
void | uploadLog (EMCallBack callback) |
List< EMContact > | getRobotsFromServer () throws HyphenateException |
EMOptions | getOptions () |
String | compressLogs () throws HyphenateException |
void | addMultiDeviceListener (EMMultiDeviceListener listener) |
void | removeMultiDeviceListener (EMMultiDeviceListener listener) |
List< EMDeviceInfo > | getLoggedInDevicesFromServer (String username, String password) throws HyphenateException |
void | kickDevice (String username, String password, String resource) throws HyphenateException |
void | kickAllDevices (String username, String password) throws HyphenateException |
void | sendFCMTokenToServer (String fcmToken) |
void | sendHMSPushTokenToServer (String appId, String token) |
void | sendHMSPushTokenToServer (String token) |
boolean | isFCMAvailable () |
String | getAccessToken () |
EMChatConfigPrivate | getChatConfigPrivate () |
JSONObject | getDeviceInfo () |
void | check (String username, String password, final CheckResultListener listener) |
Static Public Member Functions | |
static EMClient | getInstance () |
Static Public Attributes | |
static final String | TAG = "EMClient" |
static final String | VERSION = "3.6.2" |
IM SDK Client, entrance of SDK, used to login, logout, and get access IM modules, such as
EMChatManager chatManager = EMClient.getInstance().chatManager();
void com.hyphenate.chat.EMClient.addConnectionListener | ( | final EMConnectionListener | listener | ) |
add connection listener
listener |
void com.hyphenate.chat.EMClient.addMultiDeviceListener | ( | EMMultiDeviceListener | listener | ) |
add multiple devices listener
listener |
EMCallManager com.hyphenate.chat.EMClient.callManager | ( | ) |
get call manager
void com.hyphenate.chat.EMClient.changeAppkey | ( | String | appkey | ) | throws HyphenateException |
change appkey. Can ONLY be changed if not logged in
appkey |
EMChatManager com.hyphenate.chat.EMClient.chatManager | ( | ) |
get chat manager
EMChatRoomManager com.hyphenate.chat.EMClient.chatroomManager | ( | ) |
get chatroom manager
void com.hyphenate.chat.EMClient.check | ( | String | username, |
String | password, | ||
final CheckResultListener | listener | ||
) |
Service check interface, here is the schedule: 1.Validate the username and password user input. 2.Get dns list from server. 3.Get token from server. 4.Connect to the im server. 5.logout.(If call this method after user logged in, this step will not in schedule.)
If there is a error occurred during checking, this schedule will be broken.
username | User inputted for service check. If account has logged in before, this username would be changed to the logged in username to avoid update the current logged in account data. |
password | The password for username. if this is a logged in service check, the password would changed to the logged in password. |
listener | A listener for service check results callback. |
Contains account-validation check, get-dns check, get-token check, login check. So the EMAChatClient.CheckResultListener#onResult(int, int, String) callback will be called four times.
String com.hyphenate.chat.EMClient.compressLogs | ( | ) | throws HyphenateException |
compress log files, and return the compressed file
HyphenateException |
compress log folder into zip file, return zip file path
HyphenateException | compress log files, and return the compressed file |
HyphenateException |
EMConferenceManager com.hyphenate.chat.EMClient.conferenceManager | ( | ) |
get Conference manager
EMContactManager com.hyphenate.chat.EMClient.contactManager | ( | ) |
get contact manager
void com.hyphenate.chat.EMClient.createAccount | ( | String | username, |
String | password | ||
) | throws HyphenateException |
create an IM account on server
username | |
password |
String com.hyphenate.chat.EMClient.getAccessToken | ( | ) |
获取身份认证权限 在上传下载附件(语音,图片,文件等)时必须添加到请求header中 当出现任何异常时将返回null, 可通过判断是否为null来检测是否有问题 如果为null,在打开EMLog日志时,是可以看到异常原因。
String com.hyphenate.chat.EMClient.getCurrentUser | ( | ) |
get current logged in user id
List<EMDeviceInfo> com.hyphenate.chat.EMClient.getLoggedInDevicesFromServer | ( | String | username, |
String | password | ||
) | throws HyphenateException |
multi-device: Get all the information about the logged in devices
List<EMContact> com.hyphenate.chat.EMClient.getRobotsFromServer | ( | ) | throws HyphenateException |
get robot list
HyphenateException |
void com.hyphenate.chat.EMClient.getUserTokenFromServer | ( | final String | username, |
final String | password, | ||
final EMValueCallBack< String > | callBack | ||
) |
Fetch token by username and password.
callBack | result callback |
EMGroupManager com.hyphenate.chat.EMClient.groupManager | ( | ) |
get group manager
void com.hyphenate.chat.EMClient.init | ( | Context | context, |
EMOptions | options | ||
) |
initialize the SDK
boolean com.hyphenate.chat.EMClient.isConnected | ( | ) |
check if connected to server.
boolean com.hyphenate.chat.EMClient.isLoggedInBefore | ( | ) |
used to check if user has been logged in before and did not logout if you need check if connected to server, please use isConnected()
if(EMClient.getInstance().isLoggedInBefore()){ // enter main activity }else{ // enter login activity }
void com.hyphenate.chat.EMClient.kickAllDevices | ( | String | username, |
String | password | ||
) | throws HyphenateException |
multi-device: Forced to logout all logged in devices
HyphenateException |
void com.hyphenate.chat.EMClient.kickDevice | ( | String | username, |
String | password, | ||
String | resource | ||
) | throws HyphenateException |
multi-device: Forced to logout the specified logged in device, resource: EMDeviceInfo#getResource()
username | |
password | |
resource |
HyphenateException |
void com.hyphenate.chat.EMClient.login | ( | String | id, |
String | password, | ||
final EMCallBack | callback | ||
) | throws IllegalArgumentException |
login to IM server
id | unique IM Login ID |
password | password for this IM ID |
callback | login callback |
IllegalArgumentException |
int com.hyphenate.chat.EMClient.logout | ( | boolean | unbindToken | ) |
logout
unbindToken | whether unbind token |
void com.hyphenate.chat.EMClient.logout | ( | final boolean | unbindToken, |
final EMCallBack | callback | ||
) |
logout hyphenate IM server synchronously
unbindToken | whether unbind token |
callback | EMCallback |
void com.hyphenate.chat.EMClient.removeConnectionListener | ( | final EMConnectionListener | listener | ) |
remove connection listener
listener |
void com.hyphenate.chat.EMClient.removeMultiDeviceListener | ( | EMMultiDeviceListener | listener | ) |
remove multiple devices listener
listener |
void com.hyphenate.chat.EMClient.sendFCMTokenToServer | ( | String | fcmToken | ) |
Upload the FCM token to hyphenate server
The token will be uploaded when all the following conditions are met: 1.The token is not empty. 2.User logged in 3.Device support google play service 4.Push type is FCM com.hyphenate.push.EMPushType#FCM, you can set with EMOptions#setFCMNumber(String)
fcmToken |
void com.hyphenate.chat.EMClient.sendHMSPushTokenToServer | ( | String | appId, |
String | token | ||
) |
Send Huawei devices token to server
appId | Huawei appId |
token | Huawei device token |
Use sendHMSPushTokenToServer(String) for instead.
void com.hyphenate.chat.EMClient.setDebugMode | ( | boolean | debugMode | ) |
SDK will out put debug info if debugMode = true
debugMode |
void com.hyphenate.chat.EMClient.uploadLog | ( | EMCallBack | callback | ) |
upload local log file