Vis*_*shJ 2 sharepoint webview ios ms-wopi
我正在尝试为我的共享点文档获取正确的重定向 URL,然后我可以使用它在 iOS 的 WebView 中打开文档。目前,我给出了文档的绝对 URL,其中文档在 WebView 中呈现为 PDF(图像/只读)。而我想重定向到 Office webapp。现在我的问题是我不知道 Office Web 应用程序的 URL 是否是我可以构建的东西,例如附加 /_layouts/15/WopiFrame.aspx?sourcedoc= 或者是基于安装自定义的 URL,我们需要调用一些 Sharepoint API会让我们知道 Wopi 服务的基本 URL 是什么。
目前我正在传递类似 - https://.sharepoint.com/Shared%20Documents/demo/demo.docx 的 URL,而我想传递类似 - https://.sharepoint.com/_layouts/15/WopiFrame.aspx 的 URL? sourcedoc=/Shared%20Documents/demo/demo.docx
期待帮助。预先感谢,Vishwesh
File f = clientContext.Web.GetFileByServerRelativeUrl("/sites/ /Shared%20Documents/Title.docx");
clientContext.Load(f);
clientContext.ExecuteQuery();
ClientResult<String> result = f.ListItemAllFields.GetWOPIFrameUrl(SPWOPIFrameAction.Edit);
clientContext.Load(f.ListItemAllFields);
clientContext.ExecuteQuery();
Run Code Online (Sandbox Code Playgroud)
result.Value 包含一个 URL,如下所示: http://sharep.xxx:8080/sites/zxxx/_layouts/15/WopiFrame.aspx?sourcedoc=%2Fsites%2Fzxxx%2FShared%20Documents%2FTitle%2Edocx&action=edit
如果您根本不想访问共享点,您也可以从上面的页面中提取 Office Web Apps URL。
| 归档时间: |
|
| 查看次数: |
10910 次 |
| 最近记录: |