创建FYRtcEngine

+ (instancetype)sharedEngineWithAppId:(NSString *)appId
                             appToken:(NSString *)appToken
                             delegate:(id<FYRtcEngineKitDelegate>)delegate;
参数 是否必须 描述
appId 应用id
appToken 应用token
delegate 提供FYRtcEngineKit所有事件回调
  • 加入频道

- (void)joinChannel:(NSString *)channelId uid:(NSString *)uid option:(FYOptionData *)option;
参数 是否必须 描述
channelId 频道id,长度不超过40,支持范围: a-z,A-Z,0-9,_,-
uid 用户id,为空时SDK会生成一个uid
option 选项,可以配置最大时长、是否录音、透传数据

相关回调:

// 加入频道成功
- (void)rtcEngine:(FYRtcEngineKit *)engine didJoinChannel:(NSString *)channel uid:(NSString *)uid;

// 发生错误
- (void)rtcEngine:(FYRtcEngineKit *)engine didError:(FYError *)error;
  • 离开频道

- (void)leaveChannel;

相关回调:

// 离开频道
- (void)rtcEngine:(FYRtcEngineKit *)engine didLeaveChannel:(NSString *)channel;



results matching ""

    No results matching ""