0

在我的 BB 10 cascades App 中,我需要添加一个按钮单击侦听器,以便将 pin:210000A 等联系信息添加到 Blackberry Messenger (BBM)。为此,我正在执行以下操作...

main.qml 就像

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
}

} }

Inviter.qml 就像 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()
        }
    }
}

但我在 Qml 中收到“无法设置只读属性”错误。我还添加了

LIBS += -lbbplatformbbm LIBS += -lbbsystem 和“bar-descriptor.xml”中的 BBM 权限 我是否需要向 BBM 注册才能从我的应用程序中在 BBM 中添加联系人?以及如何解决上述错误?

请帮忙,

谢谢

4

1 回答 1

1

我猜在这里,但试试这种方式:

Container {
    property string pin
    Button {
        text: "Invite to BBM"
        onClicked: {
            invoke.query.setUri("pin:" + pin)
            invoke.trigger("bb.action.INVITEBBM")
        }
    }
    attachedObjects: [
        Invocation {
            id: invoke
            query {
                invokeTargetId: "sys.bbm.sharehandler"
                onQueryChanged: {
                    invoke.query.updateQuery()
                }
            }
        }
    ]
}
于 2013-10-23T14:07:22.870 回答