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
Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
My Device: various

Re: InvokeActionItem not recognized - does not appear in menu

[ Edited ]

Mark,

Not to ressurect a thread thats 60 days old, but can this work with variables? Basically trying to use the cascadescookbookqml main.qml and recipeitem.qml as a template. I can get it so it works fine if I explicitly write the URI: "tel:5555555555" but if i write it as uri: ListItemData.number it does not work. Similarly if I set the variable userumber = ListItemData.number and write the uri: usernumber it does not work, even if the change occurs in the onTriggered function.

 

 

                ListView {
                    id: recipeList
                    
                    dataModel: XmlDataModel {
                        source: "models/recipemodel.xml"
                    }
                    
                    listItemComponents: [
                        ListItemComponent {
                            type: "individual"
                            RecipeItem {
                            }
                        }
                    ]
                    
                    onTriggered: {
                        foinvoke.trigger("bb.action.DIAL")
                        query.uri = usernumber
                    }
                         attachedObjects: [
                             Invocation {
                                 id: foinvoke
                                 query:  InvokeQuery {
                                     mimeType: "application/vnd.blackberry.phone.startcall"
                                     uri: "tel:5555555555"
                                 }
                             }
                         ]
                
                }

If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
My Device: various

Re: InvokeActionItem not recognized - does not appear in menu

As a follow up, I also tried this:

 

              InvokeActionItem {
                    title: "*test* Call"
                    id: invoke
                    query {
                    invokeActionId: "bb.action.DIAL" //remove line to have add to contacts option
                    mimeType: "application/vnd.blackberry.phone.startcall"
                    uri: "tel:5555555555"
                }
                    onTriggered: {
                    uri= "tel:5555555556"
                    }
                }                

If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer

Re: InvokeActionItem not recognized - does not appear in menu

I never got Invoke Query to work. Documentation is ambiguous, incomplete and woefully inadequate. Don't know if it has been updated. I did get some InvokeApp()'s working from c++ by trial and error but not exactly as documentation. Same reasons as Invoke Query!

Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
My Device: various

Re: InvokeActionItem not recognized - does not appear in menu

I got the invocation to work just fine, its the variable uri (or changing the uri) that doesnt seem to work. Which part were you trying to invoke?

If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
My Device: various

Re: InvokeActionItem not recognized - does not appear in menu

Friendly bump

If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.
Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer

Re: InvokeActionItem not recognized - does not appear in menu

Mark,

 

1. Explains why my chat no longer appears - shouldn't that be in the documentation.

 

But... does not explain why my contacts get erased when I register to BBM (or it appears like it happens then!).

 

What actually I am registering to BBM - the application, the BlackBerr Id, a combination of the two? Does each application register separately? Or, if one application is registered should they all connect?

 

2. I tried latest way but sometimes it works and then it doesn't. Same with both my app and the example! Although the example started working again. Don't know if that had to do with updates to ide or not, problably not because I did not reload to device.

 

3. Worked again when I forced registration. But I know it is only a matter of time till it doesn't work again.

 

4. I cannot figure out from qml example how registration process is initiated and how the check actually gets done. And, it doesn't happen in my code, I did have to make some "real world" changes.

 

5. So that not working. thought I would try the native example. But the header files/libraries could not be found and I couldn't find any doc, mentation of what libraries were and how to include and where the header files were.

 

6. By the way how do I uninstall apps without uninstalling all of them?

 

 

Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer

Re: InvokeActionItem not recognized - does not appear in menu

Finally, I realized registration starting from QML and then verified by following process through.

 

So, I did need need to start registration from my app (c++) and was now able to trace it through with debug - debug doesn't always work which doesn't help.

 

Now, I still don't understand fully why app did work for a while without registration call and how app gets unregistered and whether it is still registered when a new version is implemented.

 

As far as BBM Chat goes I can't see that it makes sense to require a pin. That means each application would have to go out and prompt the user for a pin - who is going to know what a contacts pins are. What BBM Chat should do is go to BBM contacts screen or chats screen for selection just as is done in BBM. Or just forget it altogether and go to hub and select BBM.

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: InvokeActionItem not recognized - does not appear in menu

There is an issue that is preventing the URI from being updated in the onTriggered method.  You can track the status of the bug here:  InvokeActionItem onTriggered doesn't update URI

 

For opening a BBM chat, you have the option of starting the chat with a specific PIN or without a contact selected, which brings up the BBM contact list page for the user to select.  Here are examples of both.

 

Opening with a specific PIN:

 

InvokeActionItem {
    title: "Start BBM Chat"
    query {
        invokeActionId: "bb.action.BBMCHAT"
        uri: "pin:210000A"
    }
}

 

Opening without a PIN, allowing the user to choose (text can be blank if you don't want to prepopulate the chat with a message).

 

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."
    }
}

 

 

 

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
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
My Device: 9300

Re: InvokeActionItem not recognized - does not appear in menu

Hi

    I need to do invite BBM by clicking  the button in qml, i can able to go INVITE BBM page can't able to invite the     contacts

         Button {
                text:"invite" 
              onClicked: {
                    invokeQuery.uri= "pin:210000A"
                    invokeQuery.updateQuery();
                }
                attachedObjects: [
                    Invocation {
                           id: invokeShare
                           query: InvokeQuery {
                               id:invokeQuery
                              }
                           onArmed: {
                                   trigger("bb.action.INVITEBBM");
                           }                                        
                        }]
                     }

 Can anyone send some solutions to this

 thanks

Regular Contributor
pskarton
Posts: 70
Registered: ‎09-06-2012
My Device: Developer

Re: InvokeActionItem not recognized - does not appear in menu

I haven't found that the invokes work without some fiddling - poor documentation and examples - sorry -  and probably poorly thought out implementation.

Even example above just posted for chat did not work.

Invoke is ignored in QML if parameters not correct

I got a combination of qml/c++ to work with invite to download example from github, had to implement BBM registration as well of course from sample set of examples

 

qml

 

actions: [

ActionItem

title: qsTr("BBM: Invite To Download"

onTriggered: {

myapp.inviteToDownloadPage();

}

 

c++ method

 

void myapp::inviteToDownloadPage() {

InviteToDownload* invite = new InviteToDownload();

invite->sendInvite();

}