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

Native Development

Reply
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Share a screenshot of my app with the invocation framework

I know how to share a text, but I don't know how to share an actual screenshot of my app, any ideas?
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Share a screenshot of my app with the invocation framework

Hi,

 

You should be able to do this with the capture API, followed by sharing like you would share any other image...

 

https://developer.blackberry.com/native/reference/core/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_r...

 

Thanks.

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Re: Share a screenshot of my app with the invocation framework

Sorry to bother you, but can you show me an example of what I have to put on my c file for that to work?
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Share a screenshot of my app with the invocation framework

Hi,

 

There's also the cascades version - it has some sample code in the doc page;

 

https://developer.blackberry.com/native/reference/cascades/bb__system__screenshot.html

 

Thanks!

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Re: Share a screenshot of my app with the invocation framework

Hi, Tnks for the info, it's better that way, but, I'm having problems making the connection to the invokeActionItem, it make the share dissappear from my app, what am I doing wrong?

InvokeActionItem {
title: qsTr("share") + Retransmite.onLocaleOrLanguageChanged
imageSource: "asset://images/048.%20Share.png"
query {
mimeType: "image/jpeg"
InvokeActionId: "bb.action.SHARE"
uri: "file:data/screenshot.png"
}
onTriggered: {
screenshot.captureDisplay("file:data/screenshot.png);

I got screenshot as an attachedOBject

Screenshot {
id: screenshot
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Share a screenshot of my app with the invocation framework

Hi,

 

I think you need the full path in the URI for sharing.

 

Thanks.

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Re: Share a screenshot of my app with the invocation framework

hi, i think i make it now with the full path according to the target file system navigator, but the share button doesnt appear either

 

 InvokeActionItem {
                        title: qsTr("Share") + Retranslate.onLocaleOrLanguageChanged
                        imageSource: "asset:///images/048.%20Share.png"
                        query {
                            mimeType: "image/jpeg"
                            invokeActionId: "bb.action.SHARE"
                            uri: "file://accounts/1000/appdata/com.example.WeatherNow.testDev__WeatherNowf2c2bef3/data/screenshot.png"
                        }
                        onTriggered: {
                            screenshot.captureDisplay("file:data/screenshot.png");
                        }
                        
                    }

Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Share a screenshot of my app with the invocation framework

Hi,

 

Have you confirmed that the capture actually happened? (ie: does that file exist?)

 

Thanks!

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Re: Share a screenshot of my app with the invocation framework

Mmm the problem is that the share button doesn't even appear anymore
Please use plain text.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1
My Carrier: Movistar

Re: Share a screenshot of my app with the invocation framework

According to the target file system navigator, the file doesn't exist, but as I said the share button doesn't even appear anymore
Please use plain text.