当前位置: 首页>>代码示例>>Java>>正文


Java CustomNotificationConfig类代码示例

本文整理汇总了Java中com.netease.nimlib.sdk.msg.model.CustomNotificationConfig的典型用法代码示例。如果您正苦于以下问题:Java CustomNotificationConfig类的具体用法?Java CustomNotificationConfig怎么用?Java CustomNotificationConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CustomNotificationConfig类属于com.netease.nimlib.sdk.msg.model包,在下文中一共展示了CustomNotificationConfig类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateRoomSuccess

import com.netease.nimlib.sdk.msg.model.CustomNotificationConfig; //导入依赖的package包/类
private void onCreateRoomSuccess(String roomName, List<String> accounts) {
    String teamID = transaction.getTeamID();
    // 在群里发送tip消息
    IMMessage message = MessageBuilder.createTipMessage(teamID, SessionTypeEnum.Team);
    CustomMessageConfig tipConfig = new CustomMessageConfig();
    tipConfig.enableHistory = false;
    tipConfig.enableRoaming = false;
    tipConfig.enablePush = false;
    String teamNick = TeamDataCache.getInstance().getDisplayNameWithoutMe(teamID, DemoCache.getAccount());
    message.setContent(teamNick + getActivity().getString(R.string.t_avchat_start));
    message.setConfig(tipConfig);
    sendMessage(message);
    // 对各个成员发送点对点自定义通知
    String teamName = TeamDataCache.getInstance().getTeamName(transaction.getTeamID());
    String content = TeamAVChatHelper.sharedInstance().buildContent(roomName, teamID, accounts, teamName);
    CustomNotificationConfig config = new CustomNotificationConfig();
    config.enablePush = true;
    config.enablePushNick = false;
    config.enableUnreadCount = true;

    for (String account : accounts) {
        CustomNotification command = new CustomNotification();
        command.setSessionId(account);
        command.setSessionType(SessionTypeEnum.P2P);
        command.setConfig(config);
        command.setContent(content);
        command.setApnsText(teamNick + getActivity().getString(R.string.t_avchat_push_content));

        command.setSendToOnlineUserOnly(false);
        NIMClient.getService(MsgService.class).sendCustomNotification(command);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:33,代码来源:TeamAVChatAction.java

示例2: sendTypingCommand

import com.netease.nimlib.sdk.msg.model.CustomNotificationConfig; //导入依赖的package包/类
/**
 * 发送“正在输入”通知
 */
private void sendTypingCommand() {
    if (container.account.equals(NimUIKit.getAccount())) {
        return;
    }

    if (container.sessionType == SessionTypeEnum.Team || container.sessionType == SessionTypeEnum.ChatRoom) {
        return;
    }

    if (System.currentTimeMillis() - typingTime > 5000L) {
        typingTime = System.currentTimeMillis();
        CustomNotification command = new CustomNotification();
        command.setSessionId(container.account);
        command.setSessionType(container.sessionType);
        CustomNotificationConfig config = new CustomNotificationConfig();
        config.enablePush = false;
        config.enableUnreadCount = false;
        command.setConfig(config);

        JSONObject json = new JSONObject();
        json.put("id", "1");
        command.setContent(json.toString());

        NIMClient.getService(MsgService.class).sendCustomNotification(command);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:30,代码来源:InputPanel.java


注:本文中的com.netease.nimlib.sdk.msg.model.CustomNotificationConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。