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
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
My Carrier: Bell Mobility
Accepted Solution

InvokeActionItem not recognized - does not appear in menu

Cannot get InvokeActionItem to recognized and/or executed

 

Copied code ffrom documentation (2 places, more or less identical) and added to my actions. My ActionItems still appeared in menu and executed but the InvokeActionItem entries did not appear in menu and when I forced them to the ActionBar I got the error below at execution time

 

QML Code

 

at end of page definition

 

actions: [

   ActionItem {

       title: qsTr("Sound")

      ActionBar.placement: ActionBarPlacement.OnBar

     onTriggered: {

     myClass.displaySettingsPage("sound");

    }

    },

   ActionItem {

     title: qsTr("BBM: View and Update Profile")

     ActionBar.placement: ActionBarPlacement.OnBar

    onTriggered: {

   myClass.displayProfilePage(); //from example

     }

   },

InvokeActionItem {
    title: "Invite to BBM"
  

   ActionBar.placement: ActionBarPlacement.OnBar


    query {
        invokeActionId: "bb.action.INVITEBBM"
        //uri: "pin:2100000A"
    }
},
InvokeActionItem {
    title: "Start BBM Chat"
  

   ActionBar.placement: ActionBarPlacement.OnBar


    query {
        invokeActionId: "bb.action.BBMCHAT"
        //uri: "pin:2100000a"    
    }
},
 
other ActionItems
]
AttachedObjects [
   ...
]
} // end page
 
 

Here is error message I get

 

InvocationWrapper::smileysurprised:nQueryFinished: menu service population failed
query mimeType=""
query uri=QUrl("")
query data= ""
query action= "bb.action.BBMCHAT"
query target= ""
query perimeter= 0
MenuManager.error()= 1
MenuManager.isFinished()= true

InvocationWrapper::smileysurprised:nQueryFinished: no matching result from Menu Service for query
mimeType="image/png"
uri=QUrl("")
data= ""
perimeter= 0
action= "bb.action.OPEN"
target= ""

InvocationWrapper::smileysurprised:nQueryFinished: menu service population failed
query mimeType=""
query uri=QUrl("")
query data= ""
query action= "bb.action.INVITEBBM"
query target= ""
query perimeter= 0
MenuManager.error()= 1
MenuManager.isFinished()= true

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

Re: InvokeActionItem not recognized - does not appear in menu

Your "Start BBM Chat" and "Invite to BBM" InvokeActionItems require a valid URI.  If it's missing they won't appear.  In the case for chat, the URI has to be a PIN of a BBM contact.

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.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
My Carrier: Bell Mobility

Re: InvokeActionItem not recognized - does not appear in menu

Yes, but the QML parser doesn't know that a URI is needed.

 

It explains why my C++ call failed when I tried it without a URI too but not why the action was not added to the Menu.

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

Re: InvokeActionItem not recognized - does not appear in menu

Not all InvokeActionItems require a URI, so the QML parser isn't displaying an error.  But those two action IDs do.

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.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
My Carrier: Bell Mobility

Re: InvokeActionItem not recognized - does not appear in menu

The example in the documentation doesn't make sense then.

 

No one would put a hard coded invite into a menu, 'a menu item to invite only one person'. Is it the pin of the "inviter" or the pin of the "invitee". I thought it was the "invitee" expecting a display of a page into which the pin or some other way of identifying the person to be invited and then the invite is sent.

 

Or, is it not a menu item at all and a simple invoke with a pin already selected from another page. If this is true why do both examples that I have seen show InvokeActionItem as being shown with other menu items. And, if they are not menu items how do you invoke it - where in the user interface does this occur. If it were a slot it could be signalled but I don't see that in the examples.

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

Re: InvokeActionItem not recognized - does not appear in menu

What are you trying to do, dynamically choose a contact from within your application or do you want the BBM contact picker to appear, allowing the user to choose a contact (both are possible)?

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.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
My Carrier: Bell Mobility

Re: InvokeActionItem not recognized - does not appear in menu

Go to your slide from your presentation last week "Invoking BBM"

On that slide on the right is what looks like a menu on which there are 5 entries.

 

Is that a menu or is is not.?

 

Then, for each menu you have a slide.

 

For  BBM Chat you have

 

Start a BBM chat

 

InvokeActionItem {

 title: "Start BBM Chat"

 query {

    blah blah blah

}

}

The docuiumentation and samples show the InvokeActionItems in a list of Actions implying that this is what creates the Menu item and when slected the page on the righT on this slide will appear.

 

If that is not the case then what do these two slides actually mean?

 

So I followed the documentation example and added the InvokeActionItems to my action list (inferred by your slides) but they do not appear in the  menu. ActionItems do but not InvokeActionItems.

 

If the documentation is not correct than how is a InvokeActionItem included in and invoked from QML.

 

 

 

 

 

 

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

Re: InvokeActionItem not recognized - does not appear in menu

You are correct.  Here is the QML that I used to create the screenshots in the presentation.  Note that there is a bug in the current public OS that can cause some "share over NFC" type menu items to appear.  What you see in my presentation is what should happen and what'll be shown in the next OS update.

 

The onTriggered methods used here are optional.  I just list them for demonstration.  There is also a bug in the current OS that prevents updating the URI in the onTriggered method.  This will also be fixed in the next OS release.

 

import bb.cascades 1.0

Page {
    content: Container {
        Label {
            id: myLabel
            text: "BBM Invocation Demo"
        }
    }
    actions: [
        InvokeActionItem {
            title: "Start BBM Chat"
            ActionBar.placement: ActionBarPlacement.OnBar
            query {
                invokeActionId: "bb.action.BBMCHAT"
                uri: "pin:2100000A"  //<- This has to be a PIN in your BBM contacts or this won't appear in the menu.
            }
            onTriggered: {
                uri = "pin:2100000B"  //<- This also has to be a PIN in your BBM contacts, or else PIN above would be used.
            }
        },
        InvokeActionItem {
            title: "Set BBM Avatar Pic"
            query {
                invokeTargetId: "sys.bbm.imagehandler"
                invokeActionId: "bb.action.SET"
                uri: "file:///accounts/1000/shared/photos/avatar.png"
            }
        },
        InvokeActionItem {
            title: "Invite to BBM"
            query {
                invokeActionId: "bb.action.INVITEBBM"
                uri: "pin:2100000A"
            }
        },
        InvokeActionItem {
            title: "Share Text Over BBM"
            query {
                mimeType: "text/plain"
                invokeTargetId: "sys.bbm.sharehandler"
                invokeActionId: "bb.action.SHARE"
                data: "This is some text to share."
            }
            onTriggered: {
                data = "Some new text"
            }
        },
        InvokeActionItem {
            title: "Share Image Over BBM"
            query {
                invokeTargetId: "sys.bbm.sharehandler"
                invokeActionId: "bb.action.SHARE"
                uri: "file:///accounts/1000/shared/photos/avatar.png"
            }
        }
    ]
}

 

 

 

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.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer
My Carrier: Bell Mobility

Re: InvokeActionItem not recognized - does not appear in menu

Recompiled with Gold version and InvokeActionItems now appear in menu. They are all grouped after action items on menu no matter where they are placed in QML.

 

Now just have to figure out  1) why I can no longer register app with BBM in Gold and 2) how to dynamically change the uri's seeing as there is no prompt

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

Re: InvokeActionItem not recognized - does not appear in menu

Glad it's working for you now.  :smileyhappy:

 

Refer to this link for the registration issue.

 

BlackBerry Messenger Social Platform Registration Changes

 

As for changing the URI, have a look at the onTriggered method I have above.  You can change the URI there, pointing it to a variable or control in your application.

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.