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

Adobe AIR Development

Reply
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

BB10 - How do I get my app listed in the share menu?

Hi,

 

how do I get my app listed in the share menu?

 

I would like that a user can share selected text with my app.

I already added the BB10 invocation framework.

 

What do I need to add to my bar-desciptor.xml file to make that happend? 

 

Thanks for any examples! :smileyhappy:

Vibes

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 - How do I get my app listed in the share menu?

Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: BB10 - How do I get my app listed in the share menu?

This is from my bar-descriptor.xml:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qnx>
  <initialwindow>
    <systemchrome>default</systemchrome>
    <transparent>false</transparent>
  </initialwindow>
  <publisher>Jay Dee</publisher>
  <splashscreen>AppIconsForPublish/myapp_splash.jpg</splashscreen>
 <category>core.media</category> 
  <buildId>100</buildId>
  <platformVersion>1.0.0.0</platformVersion>
  <icon>
  	<image>AppIconsForPublish/myapp_114.png</image>
  </icon>
<author>Jay Dee</author>
<authorId>abcdefg</authorId>

 <invoke-target id="com.myapp.bb">
   <invoke-target-type>application</invoke-target-type>
   <filter>
      <action>bb.action.OPEN</action>
      <mime-type>text/plain</mime-type>
   </filter>
    </invoke-target>
    
<action system="true">run_air_native</action>
</qnx>

I want to allow other apps to send text to my app over the share menu. 

 

What is wrong with the code?

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 - How do I get my app listed in the share menu?

[ Edited ]

Try capital APPLICATION

Make certain your id is unique based on the type of target ("com.myapp.bb.app") vs. viewer.

 

More here:

https://developer.blackberry.com/html5/documentation/rim_invoke-target.html

 

You said you want to "share" but your action is "open".  If you want to share, then it is "bb.action.SHARE".

Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: BB10 - How do I get my app listed in the share menu?

You said you want to "share" but your action is "open". If you want to share, then it is "bb.action.SHARE

 

That one is confusing for me.

My app should launch after a user selected a text (in the browser or other app) and shared it over the "share menu" to my app.

That text should be passed into my then.

 

Do I need OPEN or SHARE for that? 

 

Thanks for your help.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 - How do I get my app listed in the share menu?

More of a question of what the client is requesting. The "shares" I have seen has to do with cards. Try providing both and see what happens (different target definitions).
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: BB10 - How do I get my app listed in the share menu?

Tried this code but my app doesn't show up in the "share menu":

 

 <invoke-targetid="com.myapp.bb.viewer">
<type>VIEWER</type>
<filter>
             <action>bb.action.OPEN</action>
<mime-type>text/csv</mime-type>
<mime-type>text/xls</mime-type>
<mime-type>text/plain</mime-type>
	     </filter>
  </invoke-target>
  
 <invoke-target id="com.myapp.bb.app">
   <invoke-target-type>APPLICATION</invoke-target-type>
   <filter>
      <action>bb.action.SHARE</action>
<mime-type>text/csv</mime-type>
<mime-type>text/xls</mime-type>
<mime-type>text/plain</mime-type>
<mime-type>text/*</mime-type>
<propertyvar="uris"value="file://"/>
<propertyvar="exts"value="csv,xls,plain"/>
   </filter>
    </invoke-target>
    
<action system="true">run_air_native</action>

 Should the code work?

Maybe the QNDEVICE.ane AIr native extension is not working?

 

Thanks.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 - How do I get my app listed in the share menu?

Invocation works in AIR apps. Maybe you are over-restricting it with all your mime types. So you can "open as a viewer" and "share as an app"?
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: BB10 - How do I get my app listed in the share menu?

Where can I find a working example? 

I simply want that my app shows up in the "share menu" if a text needs to be shared.

 

Thanks.

Developer
shawnblais
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: BB10 - How do I get my app listed in the share menu?

I just got this working with Images, made a super simple post about it, might help ya out:

http://esdot.ca/site/2013/bb10-introduction-to-the-invocation-framework

 

I'm showing up in the share menu now, and loading images just fine.