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
Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

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

Hi,

I thought some share targets would not appear, when not valid...

The code you pasted doesn't have a complete URL to save the image to..

Try and make sure the capture is going where you want it, then get the share to work...

Thanks.
--
Rob is no longer associated with BlackBerry.
Developer
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1

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

I make just the screenshot alone, and it send me a permission required to allow my app to take a screenshot, i allow it, but doesnt appear on the data path on the target file system navigator, aside of that, is it neccesary to the user to allow everytime i want a share the screenshot, im not completely sure if thats the way i want it in my app, i just want the share button seemlessly go with the screenshot in itself to share

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

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

ill check on my phone and it is working, but they are on the camera roll, also, it seems that it is making a completeley screenshot including my actions in the overflowaction menu, is there an option to make it just for the screen or something like that?, and well im gonna try to connect it with the share funcionality now

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

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

seems that its ignoring the path and send it to camera roll with an automatic number so in that way i could not know the exact path to put in the invokeActionItem, and i dont want to fill the camera roll with screenshots either, but i dont know why its doing it like that

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

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

Hi,

 

I'll try and find out why it's doing that. In the mean time - you could monitor that directory... Share then delete...

 

Thanks.

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

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

hi, after many attempts with the invokeActionItem, i found and example callled appshot from the developer site, and they work it out on with some code in c, and the screenshot in qml but with captureWindow and withouth the annoying message that the user would have to accept, but the only problem im having is to make the correct target to the normal invokeActionItem share, until now with the code, it sends me to foursquare, is there a way to make the target to the regular invokeActionItem share funcionality, here is my code

 

cpp

 

void WeatherNowApp::showPhotoInCard(const QString fileName)
{
    bb::system::InvokeManager manager;
    bb::system::InvokeRequest request;

    // Setup what to show and in what target.
    request.setUri(QUrl::fromLocalFile(fileName));
    request.setAction("bb.action.SHARE");
    InvokeTargetReply *targetReply = manager.invoke(request);

    // Setting the parent to "this" will make the manager live on after this function is destroyed
    manager.setParent(this);

    if (targetReply == NULL) {
        qDebug() << "InvokeTargetReply is NULL: targetReply = " << targetReply;
    } else {
        targetReply->setParent(this);
    }
}

 

hpp

 

public:

 Q_INVOKABLE void showPhotoInCard(const QString fileName);

 

QML

 

QTimer{
          id: timer3
          interval:250
          onTimeout: {
              var filePath = screenshot.captureWindow( "file:data/screenshot.jpg", Application.mainWindow.handle );
              _WeatherNow.showPhotoInCard(filePath);
              timer3.stop();

},

 Screenshot{
            id:screenshot   
        }

 

And then the action

 

ActionItem {
                        title: qsTr("Share") + Retranslate.onLocaleOrLanguageChanged
                        imageSource: "asset:///images/048.%20Share.png"
                        
                        onTriggered: {
                            timer3.start();
                        } 

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

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

Hi,

 

Some targets respond differently with a payload in the share, vs a URL...

 

Thanks.

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

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

So how do I work it out? I also put request.mimeType to image/png, but stills send me to foursquare
Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

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

Try loading the image in, and then set it on the request with;

 

https://developer.blackberry.com/native/reference/cascades/bb__system__invokerequest.html#function-s...

 

 

--
Rob is no longer associated with BlackBerry.