我UIActivityViewController
在不同的社交媒体上分享图像、视频和 LivePhoto。
但是当我在WhatsApp上分享LivePhoto时,会发生以下情况:
- 当 ActivityViewController 存在时 -> 单击 WhatsApp -> 它显示第二个联系人列表并快速关闭,当我尝试使用
ActivityViewController
Completion 处理程序打印错误时,它会打印如下内容:
[核心] SLComposeViewController remoteViewController: didTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} [核心] SLComposeViewController completeWithResult: 0 [核心] SLComposeViewController 跳过显式关闭,因为 isBeingDismissed 已经是 1 SLComposeViewController dealloc
I have tried with this code :
PHImageManager.default().requestImageData(for: selectedAsset, options: nil, resultHandler: { (imgData, str, image, info) in
activityItems.append(imgData!)
let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view // so that iPads won't crash
activityViewController.completionWithItemsHandler = {(activityType: UIActivityType?, completed: Bool, returnedItems:[Any]?, error: Error?) in
//Do whatever you want
print("activityType ----- \(activityType) || error ----- \(error)")
}
// present the view controller
DispatchQueue.main.async {
// self.present(activityViewController, animated: true, completion: nil)
self.navigationController?.present(activityViewController, animated: true, completion: nil)
}
})
谁能帮帮我。
谢谢你。