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
Highlighted
Developer
Posts: 188
Registered: ‎09-03-2012
My Device: Blackberry 10

Re: Invoke Email with Attachment

Just wondering, how do you insert a http link for people to click on, if you follow the invocation example in shaque's post?

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Invoke Email with Attachment

I've finally tried this from QML, and it doesn't work.

 

I verified everything by putting Shadid's C++ code into my app, then calling it from QML, and it works fine.

 

Then using an Invocation in QML, I put the identical data in place, and get this error all the time:

InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent.

Here's the QML code involved:

    attachedObjects: [
        Invocation {
            id: invoke

            query {
                invokeActionId: 'bb.action.COMPOSE'
                mimeType: 'message/rfc822'
                data: 'data:json:....(etc)...'
                // the above is identical to the C++ request.data()
            }
        }
    ]

I've tried a dozen variations on that, with no success.

 

Anyone have an idea what magic processing is being done on the data property to make this not work?


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 24
Registered: ‎02-07-2013
My Device: Z10
My Carrier: Company

Re: Invoke Email with Attachment

[ Edited ]

peter9477 wrote:

I've finally tried this from QML, and it doesn't work.

 

I verified everything by putting Shadid's C++ code into my app, then calling it from QML, and it works fine.

 

Then using an Invocation in QML, I put the identical data in place, and get this error all the time:

InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent.

Here's the QML code involved:

    attachedObjects: [
        Invocation {
            id: invoke

            query {
                invokeActionId: 'bb.action.COMPOSE'
                mimeType: 'message/rfc822'
                data: 'data:json:....(etc)...'
                // the above is identical to the C++ request.data()
            }
        }
    ]

I've tried a dozen variations on that, with no success.

 

Anyone have an idea what magic processing is being done on the data property to make this not work?


Hi Peter,

 

I think you make a mistake of the QML Invocation.

Most likely,

 

Invocation{

    query{

    }

}

 

This is unbounding invocation. What you mostly have to do is enter the actionid and mimetype. Then the OS will provide you a list of the app that can handle the action and mimetype.

I don't think you have to provide the "data" in here. Instead of it, you should use "uri"

 

Please take a look of the "Invocation data" part

https://developer.blackberry.com/cascades/documentation/device_platform/invocation/invocation_framew...

 

If you already know you have to pass "data", in most case, it should be bounding invocation.

You have to specify the targetid and cannot be done by "query{}" in qml.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Invoke Email with Attachment

Thanks Rayson, the issue of course is that with uri, you can't specify a list of attachments (or if you use the form where you can specify attachments, then you can't specify the other fields).

The point is that it's pretty trivial (with the knowledge that the InvokeRequest data should be encoded in the "data:json:" format for PPS) to do in C++, but so far there doesn't seem to be a way to do the same thing in QML.

Also, I'm pretty sure you can use Invocation {} in QML to do bounded invocations too... after all, you *can* specify an invokeTargetId. I admit I haven't experimented a whole lot with this, however, but it seems to me everything is possible with that *except* supplying the data in the format the email composition invocation requires (as shown in Shadid's post).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Developer
Posts: 1
Registered: ‎07-18-2014
My Device: Z10
My Carrier: Rogers

Re: Invoke Email with Attachment

I confirm that I can't compose an email in QML using the JSON format.  I tried various combinations with both the 10.1 and 10.2 NDK.  Seems like a bug.  If not a bug, then post sample working code and update the documention!