1

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

Vendetta
  • 513
  • 2
  • 16
  • 1
    you should hopefully be able to modify the code I used here: http://stackoverflow.com/questions/14341606/invocation-from-function-in-qml – hyarion Feb 14 '13 at 15:57
  • 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 solutions – Vendetta Feb 15 '13 at 10:29
  • 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 Feb 20 '13 at 21:36
  • yes,i need to choose the contact – Vendetta Feb 20 '13 at 23:38

1 Answers1

0

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
Sunseeker
  • 1,503
  • 9
  • 21
  • Hi,thanks for your reply, i have tried both the codes it's not going to invite page – Vendetta Feb 25 '13 at 05:33
  • yes, when i run the application it's showing alert option like(allow BBM invite to contacts)and next it's not going to next screen – Vendetta Feb 25 '13 at 07:02
  • Hi, is it possible to implement the status update when the user types some text in my application the typed status should be shown in my BBM Status how to do this in QML ...? – Vendetta Feb 28 '13 at 05:28