I'm trying to link to a .pptx file from mobile safari and have the file open in PowerPoint. My link looks like this href="ms-powerpoint:ofv|u|https://www.test.com/test.pptx" according to information at https://msdn.microsoft.com/en-us/library/office/dn906146.aspx#sectionSection8
PowerPoint Scheme = ms-powerpoint:
open-for-view-cmd = "ofv|u|" document-uri
This works on a windows desktop just fine after passing a couple of warnings, however on the iPad it opens office 365 says opening file test.pptx 0% and then gets the following error "the server you are trying to access is not supported by this version of office"
Any help would be appreciated.
I have an iPad running ios 8.3
Thanks.
According to the iOS dev docs you need to confirm if your URL scheme can be opened by an application installed on the device currently using the canOpenURL
it will return NO
if there is no app installed on the device that is registered to handle the URL’s scheme, or if you have not declared the URL’s scheme in your Info.plist file; otherwise, YES
.
If your app is linked on or after iOS 9.0, you must declare the URL schemes you want to pass to this method.
If your (iOS 9.0 or later) app calls this method using a scheme you have not declared, the method returns NO, whether or not an appropriate app for the scheme is installed on the device.
As for the structure of the actual URL it has to be encoded and must be a direct link to the file (not a redirect). If the URL is in a format that Office cannot handle, or the download simply fails, Office will not return the user to the invoking application.
Example of encoded: ms-powerpoint%3Aofv%7Cu%7Chttps%3A%2F%2Fwww.test.com%2Ftest.pptx
Also for security Office will only return users to the referring application if the file opened successfully. Backing out of the app calls the pass back protocol, open mode, URL, upload pending status, and document context. The upload pending status uses the descriptor |z|, and is either yes or no.
A combination or a single one of these issues can lead to your document failing to open.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With