Xử lý các sự kiện

Notification callback

Call notification:

1. To listen event of Call we setting notification:

   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callStateChanged:) name:OMICallStateChangedNotification object:nil];

Declare function Listen event Call State to know when call confirm or invite state: Notification key: OMICallStateChangedNotification Example

- (void)callStateChanged: (NSNotification *)notification {
   
   __weak typeof(self)weakSelf = self;
   dispatch_async(dispatch_get_main_queue(), ^{
       __weak  OMICall *call = [[notification userInfo] objectForKey:OMINotificationUserInfoCallKey];
       switch(call.callState)
       {
           case OMICallStateEarly:
               OMILogDebug(@"callStateChanged OMICallStateEarly : %@",call.uuid.UUIDString);
               break;
           case OMICallStateCalling:
               OMILogDebug(@"callStateChanged OMICallStateCalling : %@",call.uuid.UUIDString);
               break;
           case OMICallStateIncoming:{
               OMILogDebug(@"callStateChanged OMICallStateIncoming : %@",call.uuid.UUIDString);
               break;
           }
           case OMICallStateConnecting:
               OMILogDebug(@"callStateChanged OMICallStateConnecting : %@",call.uuid.UUIDString);
               break;
           case OMICallStateConfirmed:{
               OMILogDebug(@"callStateChanged OMICallStateConfirmed : %@",call.uuid.UUIDString);
              
               break;
           }
           case OMICallStateDisconnected:
               OMILogDebug(@"callStateChanged OMICallStateDisconnected : %@",call.uuid.UUIDString);
               break;
       }
   });
}

2. Listen event Media event:

Notification key: OMICallMediaStateChangedNotification Example:

3. Listen event call misscall:

4. Listen the Video call state

when event come we need to re-render video screen Detail sample project can view here: https://github.com/VIHATTeam/IOS-Objective-VideoCall-Example

5. Listen the network health for update UI instruction for user

The information we calculator on MOS score and device 3 level bellow

Last updated

Was this helpful?