08-26-2013 04:12 PM
The problem I'm seeing is that I have a file with a custom extension. When using the InvokeActionItem to share (bb.action.SHARE), I cannot get any other items other then NFC (BBM, email and so on are not available). The file, filename.xyz, just contains XML which my app handles when opened.
So, how can I fix this?
title: qsTr("Share IP")
data = ServerRepository.getServerFilePath(hostIPStr.text)
Solved! Go to Solution.
08-26-2013 06:43 PM
I am familiar with the problem.
Sharing asset files opens up the NFC interface. Sharing files that are stored somewhere else should not pose this problem.
Try to make sure your file name starts with "file://"
11-24-2013 07:18 PM
Semaphor, did that solve your problem? If so, can you mark my post as solution?
11-25-2013 02:04 PM - edited 11-25-2013 02:04 PM
So the solution isn't quite as neat as I hoped it would be. When defining an InvokeActionItem query, the uri must point to a file that exists on the file system. The mime type is then used to figure out which medium the file can be sent through.
This is definitely an undocumented requirement. What my code did was create the file to be transferred when InvokeActionItem->onTriggered() is called. This is because the contents of the file depend on what the InvokeActionItem was used on. Sharing A would result in a different file than sharing B.
Anyway, my workaround was to create an empty file just so that the InvokeAction query can be satisfied. When onTriggered() is called, then I write to that file and the file is sent through the chosen medium.
What I find frustrating was that the contents of the file has no bearing on what the InvokeActionItem does; that responsibility lies with the mime type. So, I ask, what is the point of checking if the file exists??