一旦我的voip呼叫被源或目的地断开,我试图删除callkit屏幕。
我使用了这段代码
let label = UILabel()
let stringValue = "Sample text"
let attrString = NSMutableAttributedString(string: stringValue)
attrString.addAttribute(NSKernAttributeName, 2: style, range: NSRange(location: 0, length: stringValue.characters.count))
label.attributedText = attrString
但它无法关闭callkit。任何人都可以帮我解决这个问题吗?
答案 0 :(得分:2)
您可以在呼叫断开连接方法上使用以下方法。
@property (nonatomic, strong) CXCallController *callKitCallController;
- (void)performEndCallActionWithUUID:(NSUUID *)uuid {
if (uuid == nil) {
return;
}
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:uuid];
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];
[self.callKitCallController requestTransaction:transaction completion:^(NSError *error) {
if (error) {
NSLog(@"EndCallAction transaction request failed: %@", [error localizedDescription]);
}
else {
NSLog(@"EndCallAction transaction request successful");
}
}];
}
答案 1 :(得分:0)
您必须将CXTransaction
与CXEndCallAction
一起传递到requestTransaction
。
首先在initWithCallUUID
中,您必须通过当前通话NSUUID
。然后,您可以在requestTransaction
上致电CXCallController
并将[CXTransaction transactionWithActions:@[endaction]
传递给nil
,而不是CXEndCallAction *endaction = [[CXEndCallAction alloc] initWithCallUUID:[NSUUID UUID]]; // your current call UUID
CXCallController *callController = [[CXCallController alloc] initWithQueue:dispatch_get_main_queue()];
[callController requestTransaction:[CXTransaction transactionWithActions:@[endaction]] completion:completion];
。
location ~ \.php$ {
include /usr/local/etc/nginx/fastcgi_params;
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
fastcgi_intercept_errors on;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 1200;
}