All Projects → GoBelieveIO → Im_ios

GoBelieveIO / Im_ios

Licence: mit
GoBelieveIO IM iOS sdk

Projects that are alternatives of or similar to Im ios

Im android
GoBelieveIO IM android sdk
Stars: ✭ 167 (+43.97%)
Mutual labels:  free, free-software, open-source, im
Im service
golang im server
Stars: ✭ 1,694 (+1360.34%)
Mutual labels:  free-software, open-source, im
Hippocampe
Threat Feed Aggregation, Made Easy
Stars: ✭ 149 (+28.45%)
Mutual labels:  free, free-software, open-source
Thehive4py
Python API Client for TheHive
Stars: ✭ 143 (+23.28%)
Mutual labels:  free, free-software, open-source
Thehivedocs
Documentation of TheHive
Stars: ✭ 353 (+204.31%)
Mutual labels:  free, free-software, open-source
Imaginary Teleprompter
Professional grade, free software, teleprompter app.
Stars: ✭ 157 (+35.34%)
Mutual labels:  free, free-software, open-source
Uebergame
Uebergame code repository
Stars: ✭ 90 (-22.41%)
Mutual labels:  free, free-software, open-source
Avideo
Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
Stars: ✭ 1,329 (+1045.69%)
Mutual labels:  free, free-software, open-source
Cortex Analyzers
Cortex Analyzers Repository
Stars: ✭ 246 (+112.07%)
Mutual labels:  free, free-software, open-source
Cortex
Cortex: a Powerful Observable Analysis and Active Response Engine
Stars: ✭ 676 (+482.76%)
Mutual labels:  free, free-software, open-source
Startbootstrap Sb Admin 2
Start Bootstrap is an open source library of free Bootstrap templates and themes. All of the free templates and themes on Start Bootstrap are released under the MIT license, which means you can use them for any purpose, even for commercial projects.
Stars: ✭ 9,038 (+7691.38%)
Mutual labels:  free, open-source
Startbootstrap 3 Col Portfolio
A three column Bootstrap HTML portfolio template - created by Start Bootstrap
Stars: ✭ 82 (-29.31%)
Mutual labels:  free, open-source
Startbootstrap Shop Item
A shop item Bootstrap HTML template created by Start Bootstrap
Stars: ✭ 76 (-34.48%)
Mutual labels:  free, open-source
Njupt Yellow Page
😋南京邮电大学黄页
Stars: ✭ 74 (-36.21%)
Mutual labels:  free, open-source
Startbootstrap Landing Page
A responsive, Bootstrap landing page template created by Start Bootstrap
Stars: ✭ 1,275 (+999.14%)
Mutual labels:  free, open-source
P32929.github.io
Second iteration of my portfolio - created using ReactJS, Material-UI, Overmind, etc
Stars: ✭ 84 (-27.59%)
Mutual labels:  free, open-source
Hummingbot
Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain
Stars: ✭ 4 (-96.55%)
Mutual labels:  free-software, open-source
Browser Phone
A fully featured browser based WebRTC SIP phone for Asterisk
Stars: ✭ 95 (-18.1%)
Mutual labels:  free, open-source
Pi Hole Pivpn On Google Compute Engine Free Tier With Full Tunnel And Split Tunnel Openvpn Configs
Run your own privacy-first ad blocking service in the cloud for free on Google Cloud Services.
Stars: ✭ 1,141 (+883.62%)
Mutual labels:  free, free-software
Cutehmi
CuteHMI is an open-source HMI (Human Machine Interface) software written in C++ and QML, using Qt libraries as a framework. GitHub repository is a mirror!
Stars: ✭ 90 (-22.41%)
Mutual labels:  free, open-source

#gobelieve iOS gobelieve iOS SDK

##生成demo的workspace

  1. cp demo/dev.podspec ./
  2. pod install

##应用集成到自己的客户端

  1. podfile

     pod 'gobelieve', :git => 'https://github.com/GoBelieveIO/im_ios.git'
    
  2. 在AppDelegate初始化deviceID以及message handler

     [IMService instance].deviceID = deviceID;
     [IMService instance].peerMessageHandler = [PeerMessageHandler instance];
     [IMService instance].groupMessageHandler = [GroupMessageHandler instance];
     [IMService instance].customerMessageHandler = [CustomerMessageHandler instance];
    
  3. 在AppDelegate中监听系统网络变化

     -(void)startRechabilityNotifier {
         self.reach = [GOReachability reachabilityForInternetConnection];
         self.reach.reachableBlock = ^(GOReachability*reach) {
             dispatch_async(dispatch_get_main_queue(), ^{
                 NSLog(@"internet reachable");
                 [[IMService instance] onReachabilityChange:YES];
             });
         };
         
         self.reach.unreachableBlock = ^(GOReachability*reach) {
             dispatch_async(dispatch_get_main_queue(), ^{
                 NSLog(@"internet unreachable");
                 [[IMService instance] onReachabilityChange:NO];
             });
         };
         
         [self.reach startNotifier];
    
     }
    
     [self startRechabilityNotifier];
     [IMService instance].reachable = [self.reach isReachable];
    
  4. 登录成功之后设置token和uid, token和uid从应用本身的登录接口获得

     [IMService instance].token = ""
     [PeerMessageHandler instance].uid = uid
     [GroupMessageHandler instance].uid = uid
     [CustomerMessageHandler instance].uid = uid
    
     SyncKeyHandler *handler = [[SyncKeyHandler alloc] initWithFileName:fileName];
     [IMService instance].syncKeyHandler = handler;
    
  5. 初始化消息db

     NSFileManager *fileManager = [NSFileManager defaultManager];
     if (![fileManager fileExistsAtPath:dbPath]) {
         NSString *p = [[NSBundle mainBundle] pathForResource:@"gobelieve" ofType:@"db"];
         [fileManager copyItemAtPath:p toPath:dbPath error:nil];
     }
     FMDatabase *db = [[FMDatabase alloc] initWithPath:dbPath];
     BOOL r = [db openWithFlags:SQLITE_OPEN_READWRITE|SQLITE_OPEN_WAL vfs:nil];
     if (!r) {
         NSLog(@"open database error:%@", [db lastError]);
         db = nil;
         NSAssert(NO, @"");
     }
    
     [PeerMessageDB instance].db = db;
     [GroupMessageDB instance].db = db;
     [CustomerMessageDB instance].db = db;
    
  6. 启动IMService开始接受消息

     [[IMService instance] start];
    
  7. 添加消息observer,处理相应类型的消息

     //连接状态
     [[IMService instance] addConnectionObserver:ob];
    
     //点对点消息
     [[IMService instance] addPeerMessageObserver:ob];
     //群组消息
     [[IMService instance] addGroupMessageObserver:ob];
     //直播的聊天室消息
     [[IMService instance] addRoomMessageObserver:ob];
     //实时消息,用于voip的信令
     [[IMService instance] addRTMessageObserver:ob];
     //系统消息
     [[IMService instance] addSystemMessageObserver:ob];
    
  8. app进入后台,断开socket链接

     [[IMService instance] enterBackground];
    
  9. app返回前台,重新链接socket

    [[IMService instance] enterForeground]; 
    
  10. 发送点对点消息

    PeerMessageViewController* msgController = [[PeerMessageViewController alloc] init];
    msgController.peerUID = peerUID;
    msgController.peerName = @"";
    msgController.currentUID = uid;
    [self.navigationController pushViewController:msgController animated:YES];
    
  11. 发送群组消息

    GroupMessageViewController* msgController = [[GroupMessageViewController alloc] init];
    msgController.groupID = groupID;
    msgController.groupName = @"";
    msgController.currentUID = uid;
    [self.navigationController pushViewController:msgController animated:YES];
    
  12. 用户注销

    [[IMService instance] stop]
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].