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
Contributor
jkurtw
Posts: 29
Registered: ‎01-06-2013
My Device: BB10 simulator
My Carrier: Verizon
Accepted Solution

Quick question for Device Owner - can you paste images into BBM, text msg, or email body?

Hey there BB10 dev device owner, can you quickly check and see if it is possible to copy and paste a picture/image into a BBM, text, or email message?

 

I have verified via the clipboard APIs that I am successfully loading an image onto the clipboard, but I am making a big assumption that the user has the ability to share it by pasting it into a message. If this assumption is false, I need to start down the Messages API path.

 

Secondly, how do I get a dev device? Is a PlayBook similar enough for me to test this on in a store?

 

Thanks for the help.

 

Kurt

Please use plain text.
Administrator
MSohm
Posts: 14,296
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Quick question for Device Owner - can you paste images into BBM, text msg, or email body?

[ Edited ]

This isn't supported.  You can use the invocation framework to share images over email, BBM, SMS, etc...

 

Details are here:  

 

Here's an example that does it:  Invoking core applications

 

We'll have more core applications added to that list over the next week.

 

InvokeActionItem {
    title: "Share Image Over BBM"
    query {
        invokeActionId: "bb.action.SHARE"
        uri: "file:///accounts/1000/shared/photos/image.png"
    }

 

 That will send the image as an attachment.

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
jkurtw
Posts: 29
Registered: ‎01-06-2013
My Device: BB10 simulator
My Carrier: Verizon

Re: Quick question for Device Owner - can you paste images into BBM, text msg, or email body?

Thanks again, MSohm.

Does that work for images in your "assets" folder or only shared images on the device? The only image in my build that it would not error out on was icon.png.

Instead, I built a C++ class that loads the image into a QByteArray and assigns it to the "data" property.
Please use plain text.
Administrator
MSohm
Posts: 14,296
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Quick question for Device Owner - can you paste images into BBM, text msg, or email body?

[ Edited ]

That's expected.  Other applications don't have access to your application's sandbox (install) directory.  Remember that when doing this you are actually invoking another application, running outside of your application's sandbox.

 

So you can either temporarily copy it to the shared folder or use a QByteArray like you are doing.

 


Clarified in my next post.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Administrator
MSohm
Posts: 14,296
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Quick question for Device Owner - can you paste images into BBM, text msg, or email body?

I should clarify here.  Some you can invoke using paths to some directories in your application.  Basically writable locations, like data are OK.  The invocation framework will take care of copying the file from your application's sandbox to the other application's sandbox.  You cannot do this for write protected directories, like appdata.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.