问题描述
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]; }
解决方案
我改了,但是还是发送不了 是把这里的register 和login 换成环信的账号和密码吧? 那个 EaseMessageViewController中的chatter 是不是也是环信的账号?@iosCoder:@iosCoder:
解决方案二:
在环信的后台直接注册两个账号再在app端登录测试下试试
解决方案三:
后台注册?是创建应用吗?
解决方案四:
楼主问题解决了吗?我也遇到了同样的问题