When you you open an app via a URL Scheme - e.g. system.openURL(“myapp://”) - you can also include parameters e.g. system.openURL(“myapp://myapp://doca”).
This can be decoded in the app startup function …
local function onSystemEvent( event )
if event.type == “applicationOpen” and event.url then
If you want to use third-party app then Alex has pointed you in the right direction. You refer specifically to Safari and Pages - web pages get opened by system.openURL (and can be local or remote - use http:// prefix). As far as I know you cannot directly call the Pages app by a URL Scheme but mobile Safari will open Pages (and Word or PDF) documents so you can use the same call.
Otherwise read this guide for using your own URL Schemes …
I’ve been trying to open PDF and Word documents with it (Using system.pathForFile) and it never loads. Any ideas why/Is there anything I’m doing wrong?
OK my mistake - try loading the document into a web view instead (which has the advantage of being resizable to doesn’t have to be full screen but, note, as it is a native object it displays on top of everything else) …
local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
OK I just tried it and it does only seems to work with a PDF file. I have a vague memory of using this method a few years ago but maybe it doesn’t work for local files, only ones on a web server, or something has changed? According to Apple’s documentation the web view should support other document types.
The alternative is to use the Quick Look plug-in …
So the plugin works perfectly! Thank you so much for your help, this has been a major problem for me! Also, I’m interested in the XML stuff so I’ll take a look into that too. Thank you!