会议
1. 开启会议
开启会议、分享文件、共享屏幕、音视频通话。
- (void)applicationDidEnterBackground:(UIApplication *)application {
[[Betalk sharedClient] setBadgeNumberDidEnterBackground:0];
}
参数:
名称 | 描述 |
topic | 会议的主题 |
delegate | 回调接口来处理的委托 |
inviteAttendeesBlock | 当用户点击邀请按钮回调接口通知调用应用程序 |
success | 回调接口成功启动会议,通知调用应用程序Meet ID |
failure | 回调接口通知调用应用程序错误的详细信息 启动会议失败 |
示例代码:
[[Betalk sharedClient]
startMeet: @"Betalk Meet"
withDelegate: nil
inviteAttendeesBlock: nil
success: ^(NSString *meetID) {
NSLog(@"Start meet successfully with MeetID [%@]", meetID);
} failure: ^(NSError *error) {
NSLog(@"Start meet failed, %@", [NSString stringWithFormat:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];
2. 邀请会议用户
在成功开始会议之后,邀请其他用户加入会议(N/A 如果你的app使用了BeTalk的标识符来初始化用户)
- (void)inviteAttendeesWithUserIdentityArray :(NSArray*)userIdentityArray;
参数:
名称 | 描述 |
userIdentityArray | 被邀请为会议用户身份的数组 |
示例代码:
[[Betalk sharedClient] inviteMeetAttendees:[NSArray arrayWithObjects:@"unique ID of user to be invited", nil]
success:^{
NSLog(@"Invite attendees success.");
} failure:^(NSError *error) {
NSLog(@"Invite attendees failed, %@", [NSStringstringWith Format:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];
3. 加入会议
加入现有的BeTalk会议
- (void)joinMeet:(NSString*)meetID
withUserName:(NSString*)userName
withDelegate:(id)delegate
inviteAttendeesBlock:(void(^)(NSString *meetID))inviteAttendeesBlock
success:(void(^)())success
failure:(void(^)(NSError *error))failure;
参数:
名称 | 描述 |
meetID | Betalk会议ID |
userName | 加入会议用户的名称 |
delegate | 回调接口处理委托 |
inviteAttendeesBlock | 当用户点击邀请按钮回调接口通知调用应用程序 |
success | 回调接口成功加入会议后通知Meet ID调用应用程序 |
failure | 回调接口来通知错误信息调用应用程序 加入会议失败 |
示例代码:
[[[Betalk sharedClient]
joinMeet: meetID
withDelegate: nil
inviteAttendeesBlock: nil
success: ^(NSString *meetID) {
NSLog(@"Join meet success with MeetID [%@]", meetID);
} failure: ^(NSError *error) {
NSLog(@"Join meet failed, %@", [NSString stringWithFormat:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];
4. 委托方法
该BTClientMeetDelegate协议规定BetalkSDK对象的委托可以实现的方法。该协议声明由您的应用程序实现以处理会话回调方法。
4.1 会议结束
当用户结束时发送给委托
- (void)meetEnded;
4.2 支持通过短信邀请联系人
如果你需要禁用“邀请短信”选项,实现此方法
- (BOOL)beSupportInviteContactsBySMS;
4.3 电子邮件支持
如果你需要禁用“通过电子邮件邀请”选项,现此方法
- (BOOL)beSupportInviteContactsByEmail;
4.4 隐藏邀请按钮
如果你需要隐藏邀请选项
- (BOOL)hideInviteButton;
4.5 支持自动连接音频
如果你希望用户自动加入语音会议,当他们开始或加入实现此方法。
- (BOOL)supportAutoJoinAudio;
4.6 支持自动启动屏幕共享
如果你希望用户尽快为他们开始会议共享应用程序屏幕实现此方法。
- (BOOL)supportAutoStartScreenShare;
4.7 短信内容
如果你想定制短信邀请函的内容实现此方法。
- (NSString *)bodyOfSMSContentWithMeetLink:(NSString*)meetLink;
4.8 电子邮件主题
如果您想自定义电子邮件邀请的主题实现此方法
- (NSString *)subjectOfEmailContent;
4.9 HTML电子邮件内容
如果你想定制的电子邮件邀请函的内容实现此方法
- (NSString *)HTMLBodyOfEmailContentWithMeetLink:(NSString*)meetLink;
4.10 自定义邀请信息
实自定义聊天面板中的邀请信息内容实现此方法
- (NSString *)customizedInviteMessage:(NSString *)meetLink
withBeJoinedAudio:(BOOL)beJoinedAudio
withBeStartedSharing:(BOOL)beStartedSharing;
5. 推送通知
配置推送通知,首先需要从苹果iOS导出生产证书许可证。在BeTalk应用程序配置中,上传证书和私钥文件。如果您的证书密码保护,确保在上传证书时提供相同的密码。
5.1 更新设备令牌
使用此方法更新在Betalk云设备Token
- (void)updateRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
参数:
名称 | 描述 |
deviceToken | 设备的令牌用于推送通知。 |
示例代码:
//Update device token
- (void)application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
[[Betalk sharedClient] updateRemoteNotificationsWithDeviceToken:deviceToken];
}
5.2 接受和处理推送通知
处理来自苹果推送通知服务收到推送通知
- (BOOL) receiveRemoteNotificationWithUserInfo:(NSDictionary*)userInfo;
示例代码:
//Receive Push Notification
- (void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *) userInfo {
[[Betalk sharedClient] receiveRemoteNotificationWithUserInfo:userInfo];
}
- (BOOL)receiveRemoteNotificationWithUserInfo:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
示例代码:
//Receive Push Notification
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
[[Betalk sharedClient]
receiveRemoteNotificationWithUserInfo:userInfo fetchCompletionHandler:completionHandler];
}
你可以在UIApplicationDelegate这个类中,调用这个API,来设置app角标(- (void) applicationDidEnterBackground:(UIApplication *)application),我们将在这个api中设置app角标数量(第三方伙伴角标数量+BeTalk的角标数量)
- (void)setBadgeNumberDidEnterBackground:(NSInteger)thirdPartyBadgeNumber;
示例代码:
- (void)startMeet:(NSString*)topic
withDelegate:(id<BTClientMeetDelegate>)delegate
inviteAttendeesBlock:(void(^)(NSString*meetID))inviteAttendeesBlock
success:(void(^)(NSString *meetID))success
failure:(void(^)(NSError *error))failure;