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
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Can't register as Invokable

Hi guys!

I was trying to register my app as a target for invocation, to receive simple plain text.

Following the examples in Git I added this to config:

  <rim:invoke-target id="com.myapp">
      <type>APPLICATION</type>
      <filter>
          <action>bb.action.SHARE</action>
          <mime-type>text/plain</mime-type>
      </filter>
  </rim:invoke-target>

In another app, I call the invocation framework like this:

 blackberry.invoke.invoke({
        action: "bb.action.SHARE",
        type: "text/plain",
        data&colon; "Test string"
    }, onSuccess, onError);

 But when the Share screen comes up, my target app is not included.

Am I doing something wrong here?

 

I found the documentation for the IF quite lacking, at least in webworks... its not so clear in many parts...

 

thanks!

Nuno
BlackBerry Development Advisor
Posts: 762
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Can't register as Invokable

Hi Nuno,

 

Not sure if this is a typo in your code, or just on your forum post, but in the 'invoker' code, you have this

 

data&colon; "Test string"

 Instead of

 

data&colon; "Test string"

 

Other than that,  have you checked out the sample app for doing this?  Might be worth a shot to use that as a starting point - https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/invoke

Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Can't register as Invokable

hi Chad!

Apparentely it is a bug  in the forum itself, look at your own reply Smiley Happy

My data is ok.

Nuno
BlackBerry Development Advisor
Posts: 762
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Can't register as Invokable

ahh okay Smiley Happy

 

So ya, I would start with that sample app and go from that.

Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Can't register as Invokable

I AM using the sample app Smiley Happy

when the invocation is specific to the "invokable", it works. But if I don't specificy no target app, instead of showing the me the list of available targets, it fires BBM.... :/

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

Re: Can't register as Invokable

Have you tried a query targets directly instead of the share screen?

 

You can query the targets directly: https://developer.blackberry.com/html5/apis/blackberry.invoke.html#.query

 

This way you can remove one of the varialbes from your debugging.

 

@erikjohnzon
erjohnson@blackberry.com
Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Can't register as Invokable

Hi Erik!

 

My problem is not in invoking but rather making my app invokable. I'm using the sharing screen just to make sure it appears when the user tries to share text from other apps... but so far, no luck.

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

Re: Can't register as Invokable

Try finding your taget from the invoke framework first. If you can't find it through query targets and the invoke framework then we can't either. Smiley Happy. That is a good spot to start. If you see it, then it is either a bug in our share framework.

@erikjohnzon
erjohnson@blackberry.com