聊天消息发送不了 用的是EaseUI 并且聊天界面点表情会崩
appdelegate 里面的代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
//AppKey:注册的AppKey,详细见下面注释。
//apnsCertName:推送证书名(不需要加后缀),详细见下面注释。
chatMassageViewController * vc = [[chatMassageViewController alloc]init];
UINavigationController * nv = [[UINavigationController alloc]initWithRootViewController:vc];
self.window.rootViewController = nv;
[self.window makeKeyAndVisible];
EMOptions *options = [EMOptions optionsWithAppkey:@"whcykj#test"];
options.apnsCertName = nil;
[[EMClient sharedClient] initializeSDKWithOptions:options];
EMError *error = [[EMClient sharedClient] registerWithUsername:@"1234" password:@"111111"];
if (error==nil) {
NSLog(@"注册成功");
}
EMError * error1 = [[EMClient sharedClient] loginWithUsername:@"1234" password:@"111111"];
if (!error1) {
NSLog(@"登录成功");
}
//调用EaseUI中的方法
[[EaseSDKHelper shareHelper] easemobApplication:application
didFinishLaunchingWithOptions:launchOptions
appkey:@"whcykj#test"
apnsCertName:nil
otherConfig:@{kSDKConfigEnableConsoleLogger:[NSNumber numberWithBool:YES]}];
return YES;
}
跳到聊天页面的代码
- (void)clikBtn:(UIButton *)btn{
// NSLog(@"我被点了");›
EaseMessageViewController * vc = [[EaseMessageViewController alloc] initWithConversationChatter:@"cykj" conversationType:EMConversationTypeChat];
vc.title = @"cykj";
[self.navigationController pushViewController:vc animated:YES];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
//AppKey:注册的AppKey,详细见下面注释。
//apnsCertName:推送证书名(不需要加后缀),详细见下面注释。
chatMassageViewController * vc = [[chatMassageViewController alloc]init];
UINavigationController * nv = [[UINavigationController alloc]initWithRootViewController:vc];
self.window.rootViewController = nv;
[self.window makeKeyAndVisible];
EMOptions *options = [EMOptions optionsWithAppkey:@"whcykj#test"];
options.apnsCertName = nil;
[[EMClient sharedClient] initializeSDKWithOptions:options];
EMError *error = [[EMClient sharedClient] registerWithUsername:@"1234" password:@"111111"];
if (error==nil) {
NSLog(@"注册成功");
}
EMError * error1 = [[EMClient sharedClient] loginWithUsername:@"1234" password:@"111111"];
if (!error1) {
NSLog(@"登录成功");
}
//调用EaseUI中的方法
[[EaseSDKHelper shareHelper] easemobApplication:application
didFinishLaunchingWithOptions:launchOptions
appkey:@"whcykj#test"
apnsCertName:nil
otherConfig:@{kSDKConfigEnableConsoleLogger:[NSNumber numberWithBool:YES]}];
return YES;
}
跳到聊天页面的代码
- (void)clikBtn:(UIButton *)btn{
// NSLog(@"我被点了");›
EaseMessageViewController * vc = [[EaseMessageViewController alloc] initWithConversationChatter:@"cykj" conversationType:EMConversationTypeChat];
vc.title = @"cykj";
[self.navigationController pushViewController:vc animated:YES];
}
没有找到相关结果
已邀请:
4 个回复
xiu_yun
@iosCoder:@iosCoder:
iosCoder - 单调的程序员
xiu_yun
wangqi123