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
New Developer
Posts: 6
Registered: ‎03-03-2014
My Device: BlackBerry Z10
My Carrier: Bell
Accepted Solution

"Open in Browser" and "Share" Problem

Hi all,

 

Working on my first app. I have it mostly finished, but I can't for the life of me figure out how to get the invocations working.

 

The app loads an arbitrary URL, found in variable detailView.url, in a WebView. This is working fine. However, I can't seem to pass detailView.url on to an Invocation to open in a Browser or Share. If I output detailView.url to the console, it gives me the correct URL.

 

This is what I have so far:

 

               attachedObjects: [
                    Invocation
                    {
                        id: invokeBrowser
                        query: InvokeQuery
                        {
                            mimeType: "text/html"
                            invokeActionId: "bb.action.OPEN"
                        }
                    }
                ]
                
                actions: [
                    ActionItem {
                        title: "Open in Browser"
                        imageSource: "asset:///images/ic_open.png"
                        ActionBar.placement: ActionBarPlacement.OnBar
                        onTriggered: {
                            invokeBrowser.query.uri = detailView.url;
                            console.log(detailView.url);
                            invokeBrowser.trigger("bb.action.OPEN");
                        }
                    }
                ]
            }

 

 

In the console it gives me the following error:

 

InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
   mimeType="text/html"
   uri=QUrl("") 
   data= "" 
   metadata= QMap() 
   perimeter= 0 
   action= "bb.action.OPEN" 
   target= "" 
   invokerIncluded= false 

 

I've been trying to figure this out for a few days now and just can't seem to wrap my head around it. Does anyone have any suggestions?

Thanks!

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: "Open in Browser" and "Share" Problem

I suggest using an InvokeActionItem instead, here's an example I have of changing the data within the invocation I'm sure you can adapt it for your code...

 

{
    [ ... ]

    actions: [
        InvokeActionItem {
            id: iaiBrowser
            title: "Invoke Browser"
            query.invokeActionId: "bb.action.OPEN"
            query.invokeTargetId: "sys.browser"
            query.uri: "http://www.stok.biz"
        }
    ]

    onCreationCompleted: {
        iaiBrowser.query.uri = "http://www.google.com"
    }

    [ ... ]

}

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
New Developer
Posts: 6
Registered: ‎03-03-2014
My Device: BlackBerry Z10
My Carrier: Bell

Re: "Open in Browser" and "Share" Problem

Thanks very much for your reply BBSJdev! I was able to get it working with this suggestion.

Cheers!