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
Contributor
gavoh
Posts: 23
Registered: ‎10-08-2012
My Carrier: vodafone

How to invite BBM Pin programmatically with C++ Cascades

[ Edited ]

Hi, I am tring to invite BBM Pin to contacts using C++ Cascades, I found samples to do that using QML as this

 

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()
                }
            }
        }
    ]
}

 

 

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

 But I can't find any sample to do that with C++

Please Help,

Thanks

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: How to invite BBM Pin programmatically with C++ Cascades

There are C++ samples for bound and unbound invocation on this page:  Sending invocation

 

You'd just need to swap out the values with the ones used in the QML samples you quoted.

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.
New Developer
sharath_moblie
Posts: 98
Registered: ‎09-25-2013
My Carrier: BB 10

Re: How to invite BBM Pin programmatically with C++ Cascades

hello gavoh,

 

Is it worked for you in Qml, I did the same thing but getting this error.

 

How to solve it?

 

main.qml is like

 

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

 and Inviter.qml is like

 

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()
            }
        }
    }

 but I am getting "Read only property cannot be set"error in Qml.I have also added

 

LIBS += -lbbplatformbbm
LIBS += -lbbsystem and BBM Permission in "bar-descriptor.xml"

 

Do I need to Register with BBM for Adding contact in BBM from my App? and how to fix the above error?

Please help,

Thanks

 

 

Please use plain text.