发起提问
- (void)enterAskQuestions:(NSString _Nullable)msg callback:(void (^\_nullable) (NSInteger code, TFQuestionData__Nullable model ,TFError *_Nullable error))callback
调用示例:
[self.talkfunSDK enterAskQuestions:self.setCenter.ask.textView.text callback:^(NSInteger code, TFQuestionData * _Nullable model, TFError * _Nullable error) {
if (code ==0 ) {
}
}];
接收别人的提问
- TalkfunSDKLiveDelegate 或 TalkfunSDKLifeLiveDelegate
- (void)onQuestionAsk:(TFQuestionData*_Nonnull)result
主播回答了问题
- TalkfunSDKLiveDelegate 或 TalkfunSDKLifeLiveDelegate
- (void)onQuestionReply:(TFQuestionData*_Nonnull)result
提问删除
- TalkfunSDKLiveDelegate 或 TalkfunSDKLifeLiveDelegate
- (void)onQuestionDelete:(TFQuestionData*_Nonnull)result
提问审核通过
- TalkfunSDKLiveDelegate 或 TalkfunSDKLifeLiveDelegate
- (void)onQuestionAudit:(TFQuestionData*_Nonnull)result
- 提问的sag
@interface TFQuestionData : NSObject
@property (nonatomic, copy, nonnull) NSString* course_id;
@property (nonatomic, copy, nonnull) NSString* xid;
/*提问的编号*/
@property (nonatomic, copy, nonnull) NSString* qid;
@property (nonatomic, copy, nonnull) NSString* uid;
/**回复的编号*/
@property (nonatomic, copy, nonnull) NSString* replyId;
@property (nonatomic, copy, nonnull) NSString* liveid;
/**主播回复的内容*/
@property (nonatomic, strong)NSMutableArray <TFQuestionAnswer *>* _Nullable answer;
/**内容*/
@property (nonatomic, copy, nonnull) NSString* content;
/**时间戳 例:1618036620*/
@property (nonatomic, copy, nonnull)NSString* time;
@property (nonatomic, copy, nonnull)NSString* gid;
/**头像链接*/
@property (nonatomic, copy, nonnull)NSString* avatar;
@property (nonatomic, copy, nonnull)NSString* replies;
/**角色
extern NSString * const TalkfunMemberRoleSpadmin; //超级管理员(老师)
extern NSString * const TalkfunMemberRoleAdmin; //管理员(助教)
extern NSString * const TalkfunMemberRoleUser; //普通用户(学生)
extern NSString * const TalkfunMemberRoleGuest; //游客
*/
@property (nonatomic, copy, nonnull)NSString* role;
/**名字*/
@property (nonatomic, copy, nonnull)NSString* nickname;
@property (nonatomic, copy, nonnull) NSString* sn;
@property (nonatomic, copy, nonnull) NSString* status;
/*chat:1 */
@property (nonatomic, copy, nonnull) NSString*chat;
/*删除提问*/
@property (nonatomic, copy, nonnull) NSString * deleteQuestionID;
@end
----------------------下面的代码为过期的方法,不建议使用----------------------
提问:TALKFUN_EVENT_QUESTION_ASK
@参数格式:
参数 | 类型 | 描述 |
---|---|---|
msg | NSString | 提问的内容 |
调用示例:
[talkfunSDK emit:TALKFUN_EVENT_QUESTION_ASK parameter:@{@"content":@”老师我有个问题!”} callback:^(id obj) {
{
content = 123;
nickname = "\U5146\U80fd";
qid = 40437;
replies = "<null>";
replyId = 40436;
role = spadmin;
time = 1457087721;
uid = "zb_12526";
xid = 300218;
}
}];
回复提问:TALKFUN_EVENT_QUESTION_REPLY
@参数格式:
参数 | 类型 | 描述 |
---|---|---|
replyId | NSString | 回复的提问ID |
msg | NSString | 提问的内容 |
调用示例:
[talkfunSDK emit:TALKFUN_EVENT_QUESTION_REPLY parameter:@{@"replyId":@"40437",@"msg":@”老师我有个问题!”} callback:^(id obj) {
{
content = 123;
nickname = "\U5146\U80fd";
qid = 40437;
replies = "<null>";
replyId = 40436;
role = spadmin;
time = 1457087721;
uid = "zb_12526";
xid = 300218;
}
}];
广播通知
接收提问: TALKFUN_EVENT_QUESTION_ASK
@参数说明:
参数 | 类型 | 描述 |
---|---|---|
content | NSString | 提问内容 |
xid | NSNumber | 用户唯一ID |
uid | NSString | 合作方用户ID |
qid | NSString | 提问ID |
nickname | NSString | 用户昵称 |
role | NSString | 角色 |
sn | NSNumber | 提问顺序 |
time | NSNumber | 时间戳(从1970-01-01到当前的秒数) |
调用示例:
[talkfunSDK on: TALKFUN_EVENT_QUESTION_ASK callback:^(id res) {
//返回数据
{
content = "\U5065\U5065\U5eb7\U5eb7";
nickname = rrrr;
qid = 40436;
role = user;
sn = 3;
time = 1457087675;
uid = 1185252;
xid = 337861;
}
}];
接收提问的回复: TALKFUN_EVENT_QUESTION_REPLY
@参数说明:
参数 | 类型 | 描述 |
---|---|---|
content | NSString | 回复的内容 |
replyId | NSString | 被回复的提问的ID |
qid | NSString | 回复的ID |
nickname | NSString | 回复者昵称 |
xid | NSNumber | 欢拓用户ID |
uid | NSString | 合作方用户ID |
role | NSString | 用户角色 |
time | NSNumber | 时间戳 |
调用示例:
[talkfunSDK on:TALKFUN_EVENT_QUESTION_REPLY callback:^(id res) {
//返回数据
{
content = 123;
nickname = "\U5146\U80fd";
qid = 40437;
replies = "<null>";
replyId = 40436;
role = spadmin;
time = 1457087721;
uid = "zb_12526";
xid = 300218;
}
}];
提问列表: TALKFUN_EVENT_QUESTION_LIST
@参数说明:
参数 | 类型 | 描述 |
---|---|---|
qid | NSString | 提问ID |
liveid | NSString | 直播ID |
uid | NSString | 合作方用户ID |
xid | NSNumber | 欢拓用户ID |
role | NSString | 用户角色 |
nickname | NSString | 用户昵称 |
content | NSString | 提问内容 |
time | NSNumber | 提问时间戳 |
replies | NSNumber | 回复数 |
answer | NSArray | 回复 |
调用示例:
[self.talkfunSDK on:TALKFUN_EVENT_QUESTION_LIST callback:^(id obj) {
{
code = 0;
data = {
40434 = {
content = 453453;
liveid = 1269050;
nickname = "\U5146\U80fd";
qid = 40434;
replies = 0;
replyId = 0;
role = spadmin;
sn = 1;
startTime = 3559;
status = 0;
time = 1457087092;
uid = "zb_12526";
xid = 300218;
};
40435 = {
content = 123123123;
liveid = 1269050;
nickname = "\U5146\U80fd";
qid = 40435;
replies = 0;
replyId = 0;
role = spadmin;
sn = 2;
startTime = 3564;
status = 0;
time = 1457087097;
uid = "zb_12526";
xid = 300218;
};
};
}
}];
老师删除问题信息: TALKFUN_EVENT_QUESTION_DELETE
@参数说明:
参数 | 类型 | 描述 |
---|---|---|
xid | NSNumber | 用户ID |
nickname | NSString | 用户名字 |
调用示例:
[self.talkfunSDK on:TALKFUN_EVENT_QUESTION_DELETE callback:^(id obj) {
//返回数据
{"cmd":"chat:disable","args":{"xid":337861,"nickname":"rrrr"}}
}];