Reputation: 442
Im trying to open a local app file from my iPad in Powerpoint using Microsofts Powerpoint Url Scheme: https://msdn.microsoft.com/en-us/library/office/dn911482.aspx
But Powerpoint keeps telling me that it cannot connect to server, as if it is trying to connect to a remote server, as opposed to reading the local file.
Am i supposed to register my own url scheme and have Powerpoint open it with that, or how can I have a file that is downloaded through my app opened in Powerpoint without using the UIDocumentInteractionController?
The URLs I've tried is:
ms-powerpoint:ofv|u|/Users/(user)/Library/Developer/CoreSimulator/Devices/(UDID)/data/Containers/Data/Application/(UDID)/Library/(folder-name)/ThisIsAPowerpointFile.pptx
and
ms-powerpoint:/Users/(user)/Library/Developer/CoreSimulator/Devices/(UDID)/data/Containers/Data/Application/(UDID)/Library/(folder-name)/ThisIsAPowerpointFile.pptx
It has also been tested on actual devices (not just the simulator) with the same result.
If I havent explained myself clear enough: what im trying to do is open a powerpoint file from within my app, that my app has downloaded previously without using the UIDocumentInteractionController (I don't want the user to have to choose Powerpoint, it has to be the default).
Upvotes: 2
Views: 374
Reputation: 451
As Scriptable mentioned, the security policies by apple doesn't allow any app to access contained in any another app's sandbox. So you can use UIDocumentInteractionController, pass the url of your local file and open it in any desired app.
"When your app needs to interact with files it cannot preview or open on its own, use a UIDocumentInteractionController object to manage those interactions. A document interaction controller works with the Quick Look framework to determine whether a file can be previewed in place, opened by another app, or both. Your app, in turn, works with the document interaction controller to present the available options to the user at appropriate times."
Upvotes: 1