iOS集成EaseUI3.0 使用方式 单聊 群聊 表情 去掉音视频按钮

本文介绍环信EaseUI 3.0的快速集成步骤,包括SDK集成、初始化配置、单聊及聊天室功能实现,并提供表情集成及语音、视频通话图标移除的方法。

aseUI3.0 使用方式

快速集成

 1步:集成 EaseUI前,首先需要集成环信 iOS SDK,参考:集成文档

 2 步:参考ChatDemo3.0导入的方式,直接将EaseUI拖入已经集成SDK的项目中

初始化

 1步:引入相关头文件 #import “EaseUI.h”

 2 步:在工程的 AppDelegate中的以下方法中,调用 EaseUI对应方法。

[[EaseSDKHelper shareHelperhyphenateApplication:application

                     didFinishLaunchingWithOptions:launchOptions

                                            appkey:@"panadalove#yuwan20160719"

                                      apnsCertName:@""

                                       otherConfig:@{kSDKConfigEnableConsoleLogger:[NSNumbernumberWithBool:YES]}];

集成单聊,和聊天室

-(void)roomchat

{

    EaseMessageViewController *chatController = [[EaseMessageViewControlleralloc]initWithConversationChatter:@"229351175885947308"conversationType:EMConversationTypeChatRoom];

   chatController.title=@"testgroup1";

  chatController.dataSource=self;

    [self.navigationControllerpushViewController:chatControlleranimated:YES];

   

}

 

- (void)chat

{

    EaseMessageViewController* emVC = [[EaseMessageViewControlleralloc]initWithConversationChatter:@"8004"conversationType:EMConversationTypeChat];

   emVC.title = @"小坏蛋";

    emVC.dataSource=self;

    [self.navigationControllerpushViewController:emVCanimated:YES];

}

需要实现<EaseMessageViewControllerDataSource>协议

//实现协议,自定义用户头像和昵称

- (id<IMessageModel>)messageViewController:(EaseMessageViewController*)viewController

                           modelForMessage:(EMMessage*)message

{

    id<IMessageModel> model =nil;

    model = [[EaseMessageModelalloc]initWithMessage:message];

    model.avatarImage = [UIImageimageNamed:@"EaseUIResource.bundle/user"];//默认头像

    model.avatarURLPath = @"";//头像网络地址

    model.nickname = @"昵称";//用户昵称

    return model;

}

集成表情

在EaseMessageViewController.m文件的viewDidLoad结束前添加

EaseEmotionManager * manager = [[EaseEmotionManageralloc]initWithType:EMEmotionDefaultemotionRow:3emotionCol:7emotions:[EaseEmojiallEmoji]];

[self.faceViewsetEmotionManagers:@[manager]];

不需要集成实时语音通话和视频通话的项目中去除语音通话和视频通话的图标

删除EaseChatBarMoreView.m文件中

//语音通话和视频通话

//        _audioCallButton =[UIButtonbuttonWithType:UIButtonTypeCustom];

//        [_audioCallButtonsetFrame:CGRectMake(insets * 4 + CHAT_BUTTON_SIZE * 3, 10, CHAT_BUTTON_SIZE ,CHAT_BUTTON_SIZE)];

//        [_audioCallButton setImage:[UIImageimageNamed:@"EaseUIResource.bundle/chatBar_colorMore_audioCall"]forState:UIControlStateNormal];

//        [_audioCallButton setImage:[UIImageimageNamed:@"EaseUIResource.bundle/chatBar_colorMore_audioCallSelected"]forState:UIControlStateHighlighted];

//        [_audioCallButton addTarget:selfaction:@selector(takeAudioCallAction) forControlEvents:UIControlEventTouchUpInside];

//        _audioCallButton.tag =MOREVIEW_BUTTON_TAG + 3;

//        [_scrollviewaddSubview:_audioCallButton];

//       

//        _videoCallButton =[UIButtonbuttonWithType:UIButtonTypeCustom];

//        [_videoCallButtonsetFrame:CGRectMake(insets, 10 * 2 + CHAT_BUTTON_SIZE + 10, CHAT_BUTTON_SIZE ,CHAT_BUTTON_SIZE)];

//        [_videoCallButton setImage:[UIImageimageNamed:@"EaseUIResource.bundle/chatBar_colorMore_videoCall"]forState:UIControlStateNormal];

//        [_videoCallButton setImage:[UIImageimageNamed:@"EaseUIResource.bundle/chatBar_colorMore_videoCallSelected"]forState:UIControlStateHighlighted];

//        [_videoCallButton addTarget:selfaction:@selector(takeVideoCallAction) forControlEvents:UIControlEventTouchUpInside];

//        _videoCallButton.tag=MOREVIEW_BUTTON_TAG + 4;

//        _maxIndex = 4;

//       [_scrollview addSubview:_videoCallButton];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值