Resources\\AudioFile
文件夹下的音频文件来达到替换铃声的目的:文件名 | 用途 |
phone_dialing.mp3 | 发起呼叫时的铃音 |
phone_ringing.mp3 | 接到呼叫时的铃音 |
import TUICallKit_SwiftTUICallKit.createInstance().setCallingBell(filePath: "")
#import <TUICallKit_Swift/TUICallKit_Swift-Swift.h>[[TUICallKit createInstance] setCallingBellWithFilePath:@""];
import TUICallKit_SwiftTUICallKit.createInstance().enableMuteMode(enable: true)
#import <TUICallKit_Swift/TUICallKit_Swift-Swift.h>[[TUICallKit createInstance] enableMuteModeWithEnable:YES];
import TUICallKit_Swiftimport TUICallEnginelet pushInfo: TUIOfflinePushInfo = TUIOfflinePushInfo()pushInfo.title = ""pushInfo.desc = "您有一个新的通话"pushInfo.iOSPushType = .apnspushInfo.ignoreIOSBadge = falsepushInfo.iOSSound = "phone_ringing.mp3"pushInfo.androidSound = "phone_ringing"// OPPO必须设置ChannelID才可以收到推送消息,这个channelID需要和控制台一致// OPPO must set a ChannelID to receive push messages. This channelID needs to be the same as the console.pushInfo.androidOPPOChannelID = "tuikit"// FCM channel ID, you need change PrivateConstants.java and set "fcmPushChannelId"pushInfo.androidFCMChannelID = "fcm_push_channel"// VIVO message type: 0-push message, 1-System message(have a higher delivery rate)pushInfo.androidVIVOClassification = 1// HuaWei message type: https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835pushInfo.androidHuaWeiCategory = "IM"let params = TUICallParams()params.userData = "User Data"params.timeout = 30params.offlinePushInfo = pushInfoTUICallKit.createInstance().call(userId: "123456", callMediaType: .audio, params: params) {} fail: { code, message in}
#import <TUICallKit_Swift/TUICallKit_Swift-Swift.h>#import <TUICallEngine/TUICallEngine.h>- (TUICallParams *)getCallParams {TUIOfflinePushInfo *offlinePushInfo = [self createOfflinePushInfo];TUICallParams *callParams = [TUICallParams new];callParams.offlinePushInfo = offlinePushInfo;callParams.timeout = 30;return callParams;}- (TUIOfflinePushInfo *)createOfflinePushInfo {TUIOfflinePushInfo *pushInfo = [TUIOfflinePushInfo new];pushInfo.title = @"";pushInfo.desc = @"您有一个新的通话";pushInfo.iOSPushType = TUICallIOSOfflinePushTypeAPNs;pushInfo.ignoreIOSBadge = NO;pushInfo.iOSSound = @"phone_ringing.mp3";pushInfo.AndroidSound = @"phone_ringing";// OPPO必须设置ChannelID才可以收到推送消息,这个channelID需要和控制台一致// OPPO must set a ChannelID to receive push messages. This channelID needs to be the same as the console.pushInfo.AndroidOPPOChannelID = @"tuikit";// FCM channel ID, you need change PrivateConstants.java and set "fcmPushChannelId"pushInfo.AndroidFCMChannelID = @"fcm_push_channel";// VIVO message type: 0-push message, 1-System message(have a higher delivery rate)pushInfo.AndroidVIVOClassification = 1;// HuaWei message type: https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835pushInfo.AndroidHuaWeiCategory = @"IM";return pushInfo;}[[TUICallKit createInstance] callWithUserId:@"123456"callMediaType:TUICallMediaTypeAudioparams:[self getCallParams] succ:^{} fail:^(int code, NSString * _Nullable errMsg) {}];
本页内容是否解决了您的问题?