Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
New Developer
Posts: 77
Registered: ‎10-23-2008
My Device: 9000
Accepted Solution

WebWorks App add to global Share Target?

Hi, it is possible that i can my WebWorks App added to the global Share Target like BBM, E-MAIL, BOX, DROPBOX ...?

 

cu UserNeo

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: WebWorks App add to global Share Target?

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.

@erikjohnzon
erjohnson@blackberry.com
New Developer
Posts: 77
Registered: ‎10-23-2008
My Device: 9000

Re: WebWorks App add to global Share Target?

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 Smiley Sad.

What am I doing wrong or did I forget something?Tested on current Simulator and Dev Alpha device.

 

cu

UserNeo

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: WebWorks App add to global Share Target?

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.

 

@erikjohnzon
erjohnson@blackberry.com
Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: WebWorks App add to global Share Target?

More details can be found here on the specifics of being card.* stuff: http://developer.blackberry.com/cascades/documentation/device_platform/invocation/creating_cards.htm...

 

@erikjohnzon
erjohnson@blackberry.com
New Developer
Posts: 77
Registered: ‎10-23-2008
My Device: 9000

Re: WebWorks App add to global Share Target?

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&colon;//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>

 

Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: WebWorks App add to global Share Target?

Awesome thanks for contributing back Smiley Happy.

@erikjohnzon
erjohnson@blackberry.com
New Contributor
Posts: 3
Registered: ‎03-04-2013
My Device: NA
My Carrier: NA

Re: WebWorks App add to global Share Target?

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:

  • actions=bb.action.OPEN;types=*;uris=http://;
New Developer
Posts: 77
Registered: ‎10-23-2008
My Device: 9000

Re: WebWorks App add to global Share Target?

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?

 

 

New Contributor
Posts: 3
Registered: ‎03-04-2013
My Device: NA
My Carrier: NA

Re: WebWorks App add to global Share Target?

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.