This is the app schema for Adobe reader :
com.adobe.Adobe-Reader
In Swift, you can do the following :
var docController: UIDocumentInteractionController?
if let path = Bundle.main.path(forResource: "PDF-NAME", ofType: "pdf") {
let targetURL = NSURL.fileURL(withPath: path)
docController = UIDocumentInteractionController(url: targetURL)
let url = NSURL(string:"com.adobe.Adobe-Reader:");
if UIApplication.shared.canOpenURL(url! as URL) {
docController!.presentOpenInMenu(from: .zero, in: self.view, animated: true)
print("Adobe-Reader")
}else{
print("Adobe-Reader is not installed")
}
}
And add below app schemas in plist.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.adobe.Adobe-Reader</string>
</array>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…