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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 101
Registered: ‎01-06-2014
My Device: Q10
My Carrier: EE
Accepted Solution

Email invoke not working

I'm trying to invoke email when I tap an action bar item but it doesn't work. Is something missing?:

import bb.cascades 1.2

NavigationPane {
	Page {
        actions: [
            ActionItem {
                id: action1
                title: "Tell a Friend"
                imageSource: "asset:///images/ic_email.png"
                ActionBar.placement: ActionBarPlacement.OnBar
                onTriggered: {
                    emailInvocation.query.uri = "subject=Useful travel app&body=Hello" + emailBody.text
                    emailInvocation.query.updateQuery();
                }
            }
        ]
        
	    titleBar: TitleBar {
	        title: "Welcome"
	    }
	    Container {

            }
        }
    }
    attachedObjects: [
        Invocation {
            id: emailInvocation
            query.mimeType: "text/plain"
            query.invokeTargetId: "sys.pim.uib.email.hybridcomposer"
            query.invokeActionId: "bb.action.SENDEMAIL"
            onArmed: {
                emailInvocation.trigger(emailInvocation.query.invokeActionId);
            }
        }
    ]
}

 

Developer
Posts: 265
Registered: ‎01-02-2011
My Device: Z30, PlayBook
My Carrier: AT&T

Re: Email invoke not working

Did add the pim to the .pro file?

 

Maybe because you don't have the "mailto" portion of the query.

emailInvocation.query.uri = "mailto:emailtosend@somewhere.com?Useful travel app&body=Hello" + emailBody.text

 

_________________
Meetup for BlackBerry 10
Meetup Search Tool - not available at the moment
Developer
Posts: 101
Registered: ‎01-06-2014
My Device: Q10
My Carrier: EE

Re: Email invoke not working

Added it but, still nothing

Developer
Posts: 134
Registered: ‎02-24-2013
My Device: BlackBerry Z10 LE
My Carrier: Telcel

Re: Email invoke not working

[ Edited ]

You should use IvokeActionItem to use targets.

 

It should work:

 

InvokeActionItem {
                   ActionBar.placement: ActionBarPlacement.OnBar
                   query.invokeTargetId: "sys.pim.uib.email.hybridcomposer"
                   query.invokeActionId: "bb.action.SENDEMAIL"
                   query.mimeType: ""
                   query.uri: "mailto:youremail@email.com?subject=Your%subject%here"
                   query.invokerIncluded: true
                   imageSource: "asset:///images/msg.png"
                   title: "Contact Us"
                     }

 

Developer
Posts: 101
Registered: ‎01-06-2014
My Device: Q10
My Carrier: EE

Re: Email invoke not working

Thanks a lot mate it works

Developer
Posts: 134
Registered: ‎02-24-2013
My Device: BlackBerry Z10 LE
My Carrier: Telcel

Re: Email invoke not working

You're welcome.. Smiley Wink