我想使用新的iOS 10 CallKit从应用程序拨打电话,但使用默认运营商。可能吗?如果是这样,怎么办?
目前正在使用:
public void dial(String number) {
NSURL url = new NSURL("tel://" + number);
UIApplication.getSharedApplication().openURL(url);
}
Run Code Online (Sandbox Code Playgroud) 在使用CXEndCallAction请求CXTransaction时,事务失败并显示错误代码Error Domain = com.apple.CallKit.error.requesttransaction Code = 4"(null)"
我成功地制作了一个CXStartCallAction.有谁知道这个错误意味着什么?
在我的应用程序中,我使用CallKit进行来电.应用中没有拨出电话功能.一切都很好但是当接收器或dailer结束呼叫时,它会显示带有回叫选项的CallKit UI.我不想显示回调选项,我该怎么办呢?
我结束通话的代码
func end(call: SpeakerboxCall) {
let endCallAction = CXEndCallAction(call: call.uuid)
let transaction = CXTransaction()
transaction.addAction(endCallAction)
requestTransaction(transaction, action: "endCall")
}
private func requestTransaction(_ transaction: CXTransaction, action:
String = "") {
callController.request(transaction) { error in
if let error = error {
print("Error requesting transaction: \(error)")
} else {
print("Requested transaction \(action) successfully")
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用CallKit和PushKit在Swift中开发软电话。在iOS 13之前,VoIP通知运行良好。但是,在iOS 13更新之后,我的应用程序在后台运行时没有收到VoIP推送通知。在前台didReceiveIncomingPushWith被调用,但在后台不被调用。
如何解决此问题?
码
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print("\(#function)")
let voipPushResgistry = PKPushRegistry(queue: nil)
voipPushResgistry.delegate = self
voipPushResgistry.desiredPushTypes = [PKPushType.voIP]
return true
}
func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
print("\(#function) token invalidated")
}
func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) {
let deviceToken = credentials.token.reduce("", {$0 + String(format: "%02X", $1) })
print("\(#function) token is: \(deviceToken)")
}
func …Run Code Online (Sandbox Code Playgroud) 我在我们的应用程序中实现了CallKit.我们的应用程序制作调用显示在本机电话应用程序的最新列表中.
在最近列表中点击我们的应用程序条目时,我们的应用程序已启动.有没有办法找出用于启动我们的应用程序的数字(/条目)?(openURL或其他)
有没有办法在接收VoIP呼叫时禁用Callkit的"添加呼叫"选项?
我找不到任何api来禁用它.但WhatsApp禁用了此功能.
我尝试Timer在接到电话后 12 秒添加超时,CallKit但是Appdelegate当应用程序处于后台时它不会被触发。我的代码:
self.callBackgroundHandlerIdentifier = UIApplication.shared.beginBackgroundTask(expirationHandler: {
UIApplication.shared.endBackgroundTask(self.callBackgroundHandlerIdentifier!)
self.callBackgroundHandlerIdentifier = UIBackgroundTaskInvalid
})
DispatchQueue.global(qos: .userInitiated).async {
AppDelegate.callAnswerTimer = Timer.scheduledTimer(timeInterval: 12, target: self, selector: #selector(AppDelegate.hangUpOnCallTimeOut), userInfo: nil, repeats: false)
self.callBackgroundHandlerIdentifier = UIBackgroundTaskInvalid
}
func hangUpOnCallTimeOut(){
AppDelegate.timeOutTimer?.invalidate()
AppDelegate.timeOutTimer = nil
if #available(iOS 10.0, *) {
ProviderDelegate.sharedInstance.endCall(uuids: ApplicationDelegate.activeCalls!) { (uuid) in }
}
if self.callBackgroundHandlerIdentifier != UIBackgroundTaskInvalid {
UIApplication.shared.endBackgroundTask(self.callBackgroundHandlerIdentifier!)
}
}
Run Code Online (Sandbox Code Playgroud)
任何想法我做错了什么?
我有一个用react-native编写的应用程序来处理用户之间的Voip调用.我需要在推送通知时唤醒应用程序并显示接受/拒绝呼叫的屏幕.
在iOS上有callkit,Android有什么类似的东西吗?
我想在 swift 4 iOS 中将 Apple Callkit 与 Agora VOiP 集成。
请给出任何建议我该怎么做。