teamtalk的iOS工程修改

TeamTalk源码https://github.com/mogujie/TeamTalk

Xcode 7.2下编译出错;

1.注释去掉第三方库及代码

// AppDelegate.m
// 注释去掉第三方库
//#import 
//#import 


//    [Fabric with:@[CrashlyticsKit]];

2.Library Search Paths下无用的去掉

$(PROJECT_DIR)/TeamTalk/Exist/MobClick

3.Build Phases下最后一个无用的脚本Run Script去掉

./Fabric.framework/run c85ad901eb0173a488b631e90f5913415f7424d1 bcd847cf6b15b2605cfff9400a4da335ce5ea3a0ac481dd143db404b55a09e73

无法登录:

  1. iOS9 HTTP 不能正常使用:
在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary 。
在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型 Boolean ,值设为 YES
  1. 修改测试测试消息服务器地址:
// MTTConfig.h
//#define SERVER_ADDR                             @"http://61.153.100.221:8080/msg_server"

#define SERVER_ADDR                             @"http://teamtalk.p52.cn:5000/msg_server"

  1. 注释掉默认用户名
// MTTLoginViewController.m
// 注释掉默认用户名
- (IBAction)loginButtonPressed:(UIButton*)button{
...... 
    
//    userName = @"铸剑";
//    password = @"123456";

...... 
}
        

通讯录闪退:

// ContactsModule.m
// 添加非空判断
-(NSMutableDictionary *)sortByContactPy 
{
    NSMutableDictionary *dic = [NSMutableDictionary new];
    for (MTTUserEntity * user in [[DDUserModule shareInstance] getAllMaintanceUser]) {

        //NSString *userNamePinYin = ([user.pyname isEqualToString:@""] ? user.name : user.pyname);
        
        if ([user.pyname isEqualToString:@""]) {
            continue;
        }
        
   ......      
}        

通讯录cell 点击闪退:

// MTTUserEntity.m
// NSString 赋值为 NSNumber
-(id)initWithPB:(UserInfo *)pbUser
{
    self = [super init];
    if (self) {
        self.objID = [[self class] pbUserIdToLocalID:pbUser.userId];
        self.name  = pbUser.userRealName;
        self.nick  = pbUser.userNickName;
        self.avatar= pbUser.avatarUrl;
        //self.department = @(pbUser.departmentId);
        self.department = [NSString stringWithFormat:@"%@", @(pbUser.departmentId)];
 
 ......       
}        

消息界面表情不显示:

Resource下的Bundle里的bubble.bundle没有添加进来;

蘑菇街测试服务器

http://teamtalk.p52.cn:5000/msg_server

changyu168
chang123

liaoliang
liao123

你可能感兴趣的:(teamtalk的iOS工程修改)