Lock screen effects | Effects of Applications in the Background | Effects of Applications in the Background and Expanding |
| | |
*.certSigningRequest
file.*.certSigningRequest
file.voip_services.cer
file, and the system will import it into your keychain.P12
file, be sure to set a password for it.Podfile
.pod 'TUICallKitVoIPExtension/Professional
'
Subspecs
for TUICallKit_Swift
and TUICallKitVoIPExtension
components in your Podfile
. pod install
import TUICallKitVoIPExtensionfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {// Report certificate IDTUICallKitVoIPExtension.setCertificateID(1234)return true}
#import <TUICallKitVoIPExtension/TUICallKitVoIPExtension.h>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// Report certificate ID[TUICallKitVoIPExtension setCertificateID:1234];return YES;}
pod repo update
TUICallIOSOfflinePushTypeVoIP
when calling call. The default value is TUICallIOSOfflinePushTypeAPNs
.import TUICallKit_Swiftimport TUICallEnginelet pushInfo: TUIOfflinePushInfo = TUIOfflinePushInfo()pushInfo.title = ""pushInfo.desc = "You have a new call"pushInfo.iOSPushType = .voippushInfo.ignoreIOSBadge = falsepushInfo.iOSSound = "phone_ringing.mp3"pushInfo.androidSound = "phone_ringing"// 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}
TUICallDefine.OfflinePushInfo offlinePushInfo = new TUICallDefine.OfflinePushInfo();offlinePushInfo.setTitle("");offlinePushInfo.setDesc("You have receive a new call");// For OPPO, you must set the `ChannelID` to receive push messages. The `ChannelID` must be identical with that in the console.// OPPO must set a ChannelID to receive push messages. This channelID needs to be the same as the console.offlinePushInfo.setAndroidOPPOChannelID("tuikit");offlinePushInfo.setIgnoreIOSBadge(false);offlinePushInfo.setIOSSound("phone_ringing.mp3");offlinePushInfo.setAndroidSound("phone_ringing"); //Note:don't add suffix//VIVO message type: 0-push message, 1-System message(have a higher delivery rate)offlinePushInfo.setAndroidVIVOClassification(1);//FCM channel ID, you need change PrivateConstants.java and set "fcmPushChannelId"offlinePushInfo.setAndroidFCMChannelID("fcm_push_channel");//Huawei message typeofflinePushInfo.setAndroidHuaWeiCategory("IM");//IOS push type: if you want user VoIP, please modify type to TUICallDefine.IOSOfflinePushType.VoIPofflinePushInfo.setIOSPushType(TUICallDefine.IOSOfflinePushType.VoIP);TUICallDefine.CallParams params = new TUICallDefine.CallParams();params.offlinePushInfo = offlinePushInfo;TUICallKit.createInstance(context).call("mike", TUICallDefine.MediaType.Video, params, null);
TUIOfflinePushInfo offlinePushInfo = TUIOfflinePushInfo();offlinePushInfo.title = "Flutter TUICallKit";offlinePushInfo.desc = "This is an incoming call from Flutter TUICallkit";offlinePushInfo.ignoreIOSBadge = false;offlinePushInfo.iOSSound = "phone_ringing.mp3";offlinePushInfo.androidSound = "phone_ringing";offlinePushInfo.androidOPPOChannelID = "Flutter TUICallKit";offlinePushInfo.androidVIVOClassification = 1;offlinePushInfo.androidFCMChannelID = "fcm_push_channel";offlinePushInfo.androidHuaWeiCategory = "Flutter TUICallKit";offlinePushInfo.iOSPushType = TUICallIOSOfflinePushType.VoIP;TUICallParams params = TUICallParams(offlinePushInfo: offlinePushInfo);TUICallKit.instance.call(callUserId, TUICallMediaType.audio, params);
#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 = @"You have a new call";pushInfo.iOSPushType = TUICallIOSOfflinePushTypeVoIP;pushInfo.ignoreIOSBadge = NO;pushInfo.iOSSound = @"phone_ringing.mp3";pushInfo.AndroidSound = @"phone_ringing";// For OPPO, you must set the `ChannelID` to receive push messages. The `ChannelID` must be identical with that in the console.// 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) {}];Objective-C
import TUICallKitVoIPExtension/// Implementation in AppDelegate, for versions before iOS 13func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {TUICallKitVoIPExtension.call(with: userActivity)return true}/// Implementation in SceneDelegatefunc scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {for userActivity in connectionOptions.userActivities {TUICallKitVoIPExtension.call(with: userActivity);}}func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {TUICallKitVoIPExtension.call(with: userActivity);}
#import <TUICallKitVoIPExtension/TUICallKitVoIPExtension.h>/// Implementation in AppDelegate, for versions before iOS 13- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {[TUICallKitVoIPExtension callWith:userActivity];return YES;}/// Implementation in SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)sessionptions:(UISceneConnectionOptions *)connectionOptions {[connectionOptions.userActivities enumerateObjectsUsingBlock:^(NSUserActivity * _Nonnull userActivity, BOOL * _Nonnull stop) {[TUICallKitVoIPExtension callWith:userActivity];}];}- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {[TUICallKitVoIPExtension callWith:userActivity];}
import TUICallKitVoIPExtensionfunc application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {TUICallKitVoIPExtension.call(with: userActivity)return true}
#import <TUICallKitVoIPExtension/TUICallKitVoIPExtension.h>- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {[TUICallKitVoIPExtension callWith:userActivity];return YES;}
Was this page helpful?