02-24-2013 05:21 AM
Hi, it is possible that i can my WebWorks App added to the global Share Target like BBM, E-MAIL, BOX, DROPBOX ...?
cu UserNeo
Solved! Go to Solution.
02-25-2013 08:31 AM
The invocation framework will return any invocation clients that have registered for the specific targets. If your application supports "bb.action.SHARE" and the user selects something that is of type image and you registered with image then yes you will be in the list. It does not limit the types of applications to system only.
02-25-2013 03:45 PM
Hi,
i insert the following code in the config.xml
<rim:invoke-target id="my.website.my.app"> <type>APPLICATION</type> <filter> <action>bb.action.SHARE</action> <mime-type>application/*</mime-type> <mime-type>text/*</mime-type> <mime-type>audio/*</mime-type> <mime-type>image/*</mime-type> <mime-type>message/*</mime-type> <mime-type>video/*</mime-type> </filter> </rim:invoke-target>
But now when I select any file (image, text, or other file) and click "SHARE", my app does not appear in the target list
.
What am I doing wrong or did I forget something?Tested on current Simulator and Dev Alpha device.
cu
UserNeo
02-25-2013 04:30 PM
Try enumerating the uris that you wish to be invoked with. This will help the invoke framework add this to your filter definition:
<property var="uris" value="http://,https://"/>
There is also the caveat that this type of "Share screen" requires a card composer so you need to register yourself as a "card.composer" using <type>card.composer</type> since you are telling invoke that you can handle composing a Share.
Give that a shot it worked for me.
02-25-2013 04:31 PM
More details can be found here on the specifics of being card.* stuff: http://developer.blackberry.com/cascades/documenta
02-26-2013 06:54 AM
Hi,
thanks for your help. now works perfect.
Maybe you can use this code as a sample
config.xml
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0" id="ist"> <name>IST</name> <content src="index.html"/> <author>Invoke Share Targets</author> <feature id="blackberry.invoked" version="1.0.0" required="true" /> <feature id="blackberry.invoke" version="1.0.0" required="true" /> <rim:invoke-target id="my.sharedmyok.de"> <type>card.composer</type> <filter> <action>bb.action.SHARE</action> <mime-type>application/*</mime-type> <mime-type>text/*</mime-type> <mime-type>audio/*</mime-type> <mime-type>image/*</mime-type> <mime-type>message/*</mime-type> <mime-type>video/*</mime-type> <property var="uris" value="http://,https://,data://local,file://"/> </filter> </rim:invoke-target> </widget>
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="local:///chrome/webworks.js" type="text/javascript"></script>
<script type="text/javascript">
function ready() {
blackberry.event.addEventListener("invoked", function (Info){
// File Type
Info.type;
// path of seleceted File
Info.uri;
});
};
window.addEventListener("load", function (e) {
document.addEventListener("webworksready", ready)
}, false);
</script>
</head>
<body>
</body>
</html>
02-26-2013 09:06 AM
Awesome thanks for contributing back
.
03-04-2013 03:51 AM
Neo,
Thank you so much for the feedback. I am trying to accomplish a similar task but with <action>bb.action.OPEN</action>, which for some reason allows me to compile, but when I try to install on a device I get this error
"884 Restricted Invoke Filter detected"
I saw the explination below on BB website, so I am guessing wild carding isn't possible iwth the open action. Have you discovered anything in your research related to that?
If your application uses a target filter declaration that is restricted, then on deployment, theresult::failure 884 Restricted Invoke Filter detected error is displayed in the command line tool.
Here are some examples of target filters that successfully register with invocation framework:
03-06-2013 11:29 AM
Yes, a wildcard option with * or */* is not possible. You must insert each file type separately.
<mime-type>application/*</mime-type> <mime-type>text/*</mime-type> <mime-type>audio/*</mime-type> <mime-type>image/*</mime-type> <mime-type>message/*</mime-type> <mime-type>video/*</mime-type>
What do you want to do exactly?
03-06-2013 11:41 AM
UserNeo,
I wanted to accomplish the same abilities as in share but just for open. Seems like it is a no no, so I think we are going to switch and listen to share instead. Thanks for the help.