1
votes

I have invoked invite to BBM while clicking a button in qml,but i need to send the invitation for the contacts how to do this?my code

 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 me some solutions to solve this.? Thanks

1
you should hopefully be able to modify the code I used here: stackoverflow.com/questions/14341606/…hyarion
Hi, i have modified your code(i have posted above),i can able to go invite page, but i can't able to invite the contacts,any solutionsVendetta
The code you have used above has the pin for the contact to invite hardcoded. Do you instead want to be able to choose which contacts to invite before sending the BBM invitation?nonesuchnick
yes,i need to choose the contactVendetta

1 Answers

0
votes

Invocation query is immutable object which means that values in the query are not dynamic. If you want to update query in dynamic you need to do it via control signals or variables.

For example, you have a component called Inviter with the pin property exposed:

import bb.cascades 1.0

Container {
    property string pin
    Button {
        text: "Invite to BBM"
        onClicked: {
            query.uri = "pin:" + pin
            invoke.trigger("bb.action.INVITEBBM")
        }
    }
    attachedObjects: [
        Invocation {
            id: invoke
            query: InvokeQuery {
                id: query
                invokeTargetId: "sys.bbm.sharehandler"
                onQueryChanged: {
                    invoke.query.updateQuery()
                }
            }
        }
    ]
}

Then you can use it this way:

import bb.cascades 1.0

Page {
    Container {
        layout: DockLayout {
        }
        TextArea {
            id: pinEditor
            hintText: "Enter PIN to invite"
            onTextChanged: {
                inviter.pin = text
            }
            input.submitKey: SubmitKey.Send
        }

        Inviter {
            id: inviter
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
        }
    }
}

Also, don't forget to enable "Blackberry Messenger" permission in your bar-descriptor.xml and add following libraries to your .pro file:

LIBS += -lbbplatformbbm
LIBS += -lbbsystem