ios - 无法使用 iOS 应用程序中的 Url 方案从 Web URL 打开 Microsoft PowerPoint iPad 应用程序中的 powerpoint 演示文稿

标签 ios objective-c swift ipad powerpoint

我正在构建一个包含 PowerPoint 演示文稿的 iOS 应用程序,这些演示文稿存储在服务器端。当用户从我的应用程序中选择一个演示文稿时,它需要在 PowerPoint iPad 应用程序中打开。我使用 powerpoint iPad 应用程序的 URL 方案来传递所选演示文稿的 url。但是 iPad 中的 PowerPoint 总是显示:

"The Server you are trying to access is not supported by this version of Office."

let urlString = "ms-powerpoint:https://kahanicloud.com/CustomPresentation/Download?id=58006a40775efb09d0200659&parentId=system-all-files&fileName=shared.pptx"
let  DocUrl = URL(string: urlString)
let canOpen = UIApplication.shared.canOpenURL(DocUrl!)
if canOpen
{
   UIApplication.shared.openURL(DocUrl!)
}

我尝试了上面的 Swift 代码来实现这个,但是失败了。

最佳答案

您没有为 Url 架构提供足够的参数。请尝试以下操作:

ms-powerpoint:ofe|u|https://kahanicloud.com/CustomPresentation/Download?id=58006a40775efb09d0200659&parentId=system-all-files&fileName=shared.pptx|a|App

您可以从 here 中获得所需参数的更多详细信息

关于ios - 无法使用 iOS 应用程序中的 Url 方案从 Web URL 打开 Microsoft PowerPoint iPad 应用程序中的 powerpoint 演示文稿,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40767463/

相关文章:

objective-c - 无法显示正确的 unicode 符号

iOS UTF-8 标签字符串

swift - 创建搜索栏时出错 : Initializer for conditional binding must have Option type, 而不是 'String'

ios - 在 UILabel 中看到 %20

iphone - 如何在 iOS 的 MPMoviePlayerViewController 中禁用全屏

objective-c - 如何防止 "_OBJC_IVAR_$_UIPickerView._backgroundView symbol not found"错误?

ios - ios 中的 CrashReporter 符号化客户端

swift - 如何让@AppStorage 在 MVVM/SwiftUI 框架中工作?

objective-c - 快速使用 SOMotionDetector

ios - 如何读取 info.plist 中的环境变量?