如何使用QBRTCSession对象发送自定义字符串
问题描述:
在我的应用程序中,我已经实现了用于语音和视频通话的quickblox SDK,并且一切都很完美。我只面临一个问题。为了在后台跟踪特定的呼叫,我在两个用户之间创建了一个会话。但是在打这个电话的时候,我想把同样的会话ID也发给对手。如果有人能帮助我,请告诉我,我怎么能做到这一点。如何使用QBRTCSession对象发送自定义字符串
在此先感谢
答
得到的解决方案!
参考http://quickblox.com/developers/Sample-webrtc-ios
使我有以下写在我的文件
[self.session startCall:userInfo];
在这里,你可以写USERINFO字典里的任何东西行代码的调用之前。一旦对方接到电话
- (void)didReceiveNewSession:(QBRTCSession *)session userInfo:(NSDictionary *)userInfo
将被调用。在这里,无论你在userInfo里面写了什么,你都可以直接阅读它。
[QBRTCClient.instance addDelegate:self];
// 2123, 2123, 3122 - opponent's
NSArray *opponentsIDs = @[@3245, @2123, @3122];
QBRTCSession *newSession = [QBRTCClient.instance createNewSessionWithOpponents:opponentsIDs
withConferenceType:QBConferenceTypeVideo];
// userInfo - the custom user information dictionary for the call. May be nil.
NSDictionary *userInfo = @{ @"key" : @"value" };
[newSession startCall:userInfo];
开始调用方法的定义也说了同样
/**
* Start call. Opponent will receive new session signal in QBRTCClientDelegate method 'didReceiveNewSession:userInfo:
*
* @param userInfo The user information dictionary for the stat call. May be nil.
*/
- (void)startCall:(NSDictionary *)userInfo;