本文整理汇总了Java中com.hyphenate.chat.EMOptions.setRequireAck方法的典型用法代码示例。如果您正苦于以下问题:Java EMOptions.setRequireAck方法的具体用法?Java EMOptions.setRequireAck怎么用?Java EMOptions.setRequireAck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hyphenate.chat.EMOptions
的用法示例。
在下文中一共展示了EMOptions.setRequireAck方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
protected EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
// 获取到EMChatOptions对象
EMOptions options = new EMOptions();
// 默认添加好友时,是不需要验证的,改成需要验证
options.setAcceptInvitationAlways(false);
// 设置是否需要已读回执
options.setRequireAck(true);
// 设置是否需要已送达回执
options.setRequireDeliveryAck(false);
// 设置从db初始化加载时, 每个conversation需要加载msg的个数
options.setNumberOfMessagesLoaded(1);
return options;
// notifier.setNotificationInfoProvider(getNotificationListener());
}
示例2: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
private EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
EMOptions options = new EMOptions();
// set if accept the invitation automatically
options.setAcceptInvitationAlways(false);
// set if you need read ack
options.setRequireAck(true);
// set if you need delivery ack
options.setRequireDeliveryAck(false);
//you need apply & set your own id if you want to use google cloud messaging.
options.setGCMNumber("324169311137");
//you need apply & set your own id if you want to use Mi push notification
options.setMipushConfig("2882303761517426801", "5381742660801");
//you need apply & set your own id if you want to use Huawei push notification
// options.setHuaweiPushAppId("10492024");
options.allowChatroomOwnerLeave(getModel().isChatroomOwnerLeaveAllowed());
options.setDeleteMessagesAsExitGroup(getModel().isDeleteMessagesAsExitGroup());
options.setAutoAcceptGroupInvitation(getModel().isAutoAcceptGroupInvitation());
return options;
}
示例3: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
protected EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
// 获取到EMChatOptions对象
EMOptions options = new EMOptions();
// 默认添加好友时,是不需要验证的,改成需要验证
options.setAcceptInvitationAlways(false);
// 设置是否需要已读回执
options.setRequireAck(true);
// 设置是否需要已送达回执
options.setRequireDeliveryAck(false);
// 设置从db初始化加载时, 每个conversation需要加载msg的个数
//options.setNumberOfMessagesLoaded(1);
return options;
// notifier.setNotificationInfoProvider(getNotificationListener());
}
示例4: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
protected EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
EMOptions options = new EMOptions();
// change to need confirm contact invitation
options.setAcceptInvitationAlways(false);
// set if need read ack
options.setRequireAck(true);
// set if need delivery ack
options.setRequireDeliveryAck(false);
return options;
}
示例5: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
protected EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
EMOptions options = new EMOptions();
// change to need confirm contact invitation
options.setAcceptInvitationAlways(false);
// set if need read ack
options.setRequireAck(true);
// set if need delivery ack
options.setRequireDeliveryAck(false);
return options;
}
示例6: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
private EMOptions initChatOptions() {
Log.d("DemoHelper", "init HuanXin Options");
EMOptions options = new EMOptions();
// set if accept the invitation automatically
options.setAcceptInvitationAlways(false);
// set if you need read ack
options.setRequireAck(true);
// set if you need delivery ack
options.setRequireDeliveryAck(false);
return options;
}
示例7: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
private EMOptions initChatOptions() {
Log.d(TAG, "init HuanXin Options");
EMOptions options = new EMOptions();
// set if accept the invitation automatically
options.setAcceptInvitationAlways(false);
// set if you need read ack
options.setRequireAck(true);
// set if you need delivery ack
options.setRequireDeliveryAck(false);
//you need apply & set your own id if you want to use google cloud messaging.
options.setGCMNumber("324169311137");
//you need apply & set your own id if you want to use Mi push notification
options.setMipushConfig("2882303761517426801", "5381742660801");
//you need apply & set your own id if you want to use Huawei push notification
options.setHuaweiPushAppId("10492024");
//set custom servers, commonly used in private deployment
if (demoModel.isCustomServerEnable() && demoModel.getRestServer() != null && demoModel.getIMServer() != null) {
options.setRestServer(demoModel.getRestServer());
options.setIMServer(demoModel.getIMServer());
if (demoModel.getIMServer().contains(":")) {
options.setIMServer(demoModel.getIMServer().split(":")[0]);
options.setImPort(Integer.valueOf(demoModel.getIMServer().split(":")[1]));
}
}
if (demoModel.isCustomAppkeyEnabled() && demoModel.getCutomAppkey() != null && !demoModel.getCutomAppkey().isEmpty()) {
options.setAppKey(demoModel.getCutomAppkey());
}
options.allowChatroomOwnerLeave(getModel().isChatroomOwnerLeaveAllowed());
options.setDeleteMessagesAsExitGroup(getModel().isDeleteMessagesAsExitGroup());
options.setAutoAcceptGroupInvitation(getModel().isAutoAcceptGroupInvitation());
return options;
}
示例8: initOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
/**
* 环信SDK初始化的一些配置
* 关于 EMOptions 可以参考官方的 API 文档
* http://www.easemob.com/apidoc/android/chat3.0/classcom_1_1hyphenate_1_1chat_1_1_e_m_options.html
*/
private EMOptions initOptions() {
EMOptions options = new EMOptions();
// 设置Appkey,如果配置文件已经配置,这里可以不用设置
// options.setAppKey("lzan13#hxsdkdemo");
// 设置自动登录
options.setAutoLogin(true);
// 设置是否需要发送已读回执
options.setRequireAck(true);
// 设置是否需要发送回执,
options.setRequireDeliveryAck(true);
// 设置是否需要服务器收到消息确认
options.setRequireServerAck(true);
// 设置是否根据服务器时间排序,默认是true
options.setSortMessageByServerTime(false);
// 收到好友申请是否自动同意,如果是自动同意就不会收到好友请求的回调,因为sdk会自动处理,默认为true
options.setAcceptInvitationAlways(false);
// 设置是否自动接收加群邀请,如果设置了当收到群邀请会自动同意加入
options.setAutoAcceptGroupInvitation(false);
// 设置(主动或被动)退出群组时,是否删除群聊聊天记录
options.setDeleteMessagesAsExitGroup(false);
// 设置是否允许聊天室的Owner 离开并删除聊天室的会话
options.allowChatroomOwnerLeave(true);
// 设置google GCM推送id,国内可以不用设置
// options.setGCMNumber(MLConstants.ML_GCM_NUMBER);
// 设置集成小米推送的appid和appkey
// options.setMipushConfig(MLConstants.ML_MI_APP_ID, MLConstants.ML_MI_APP_KEY);
return options;
}
示例9: initChatOptions
import com.hyphenate.chat.EMOptions; //导入方法依赖的package包/类
private EMOptions initChatOptions(){
Log.d(TAG, "init HuanXin Options");
// 获取到EMChatOptions对象
EMOptions options = new EMOptions();
// 默认添加好友时,是不需要验证的,改成需要验证
options.setAcceptInvitationAlways(false);
// 设置是否需要已读回执
options.setRequireAck(true);
// 设置是否需要已送达回执
options.setRequireDeliveryAck(false);
// 设置从db初始化加载时, 每个conversation需要加载msg的个数
//options.setNumberOfMessagesLoaded(1);
//使用gcm和mipush时,把里面的参数替换成自己app申请的
//设置google推送,需要的GCM的app可以设置此参数
options.setGCMNumber("324169311137");
//在小米手机上当app被kill时使用小米推送进行消息提示,同GCM一样不是必须的
options.setMipushConfig("2882303761517426801", "5381742660801");
options.allowChatroomOwnerLeave(getModel().isChatroomOwnerLeaveAllowed());
options.setDeleteMessagesAsExitGroup(getModel().isDeleteMessagesAsExitGroup());
options.setAutoAcceptGroupInvitation(getModel().isAutoAcceptGroupInvitation());
return options;
// notifier.setNotificationInfoProvider(getNotificationListener());
}