Invoke BBM Channels

 

If you haven't been living under a rock you will have probably heard of BlackBerry's new social network feature called BBM Channels!  It's a new fresh take on allowing people to post content and consumers to get in touch with that content.  Luckily, BlackBerry has provided a way for developers to link their channels, or other relevant channels, within their app.  This is how.

 

The project is attached at the end of this tutorial for your pleasure and to use as a starting point if you'd like.  But first I would like to highlight the main file we will be touching:

  • main.qml

 

Screenshots

 

 

main.qml

here is where we setup an app menu and place the BBM Channels invoke inside of it.  Add the following code to your main.qml under the main page brackets:

 
 
Menu.definition: MenuDefinition {
        actions: [
            
        ]
    }

Within the actions you place an action item where you can setup the BBM Channel invoke. This will allow you to name the action item as well as link it to an icon or image. Make sure to replace the uri code with your BBM Channel's ID...unless you want to check out yours truly (aka DJ BMO :P) Place the following code within the actions:

 
 
ActionItem {
                title: "BBM Channel"
                imageSource: "asset:///images/ic_bbm.png"
                attachedObjects: [
                    Invocation {
                        id: invokeBBMChannel
                        query {
                            invokeTargetId: "sys.bbm.channels.card.previewer"
                            invokeActionId: "bb.action.OPENBBMCHANNEL"
                            uri: "bbmc:C00119063"
                        }
                    }
                ]
                onTriggered: {
                    invokeBBMChannel.trigger("bb.action.OPENBBMCHANNEL")
                }
            }

At the end your code look like so:

 
 
import bb.cascades 1.0

Page {
    Menu.definition: MenuDefinition {
        actions: [
            ActionItem {
                title: "BBM Channel"
                imageSource: "asset:///images/ic_bbm.png"
                attachedObjects: [
                    Invocation {
                        id: invokeBBMChannel
                        query {
                            invokeTargetId: "sys.bbm.channels.card.previewer"
                            invokeActionId: "bb.action.OPENBBMCHANNEL"
                            uri: "bbmc:C00119063"
                        }
                    }
                ]
                onTriggered: {
                    invokeBBMChannel.trigger("bb.action.OPENBBMCHANNEL")
                }
            }
        ]
    }
    Container {
        //Todo: fill me with QML
        Label {
            // Localized text with the dynamic translation and locale updates support
            text: qsTr("Hello BBM") + Retranslate.onLocaleOrLanguageChanged
            textStyle.base: SystemDefaults.TextStyles.BigText
        }
    }
}

And there you are! You're ready to integrate your Channel and app!

 

Brandon Orr

Transportation Planner (University of Waterloo Graduate) & Blackberry 10 Developer (PinGuin App) part of the open source BB team.

Website: appworld.blackberry.com/webstore/vendor/65375/

Leave your comments

Post comment as a guest

0

People in this conversation

  • Guest (Duc Dau)

    Vietnam

    How to connect twitter?
    My code:
    ActionItem {
    title: "twitter"
    imageSource: "asset:///images/twitter.png"
    attachedObjects: [
    Invocation {
    id: invoketwitter
    query {
    invokeTargetId: "com.twitter.urihandler"
    invokeActionId: "bb.action.VIEW"
    uri: "twitter:connect:@DauDuc1"
    }
    }
    ]
    onTriggered: {
    invoketwitter.trigger("bb.action.VIEW")
    }
    }
    it not work? , please me, thank.

    Like 0 Short URL:
  • Guest (DFV)

    dhhgdfzyujhgmhghugyjghbcfgxhcfgxhdzh

    Like 0 Short URL:
  • Guest (Kristi)

    I see in the post some different kinds of the coding of the programming. BMM channel seeing the some show of here. I am appreciate in the work. Thanks for sharing in the post. keep it up.
    Heavy Duty Racking

    Like 0 Short URL:
  • Guest (Robert)

    Invoke BBM Channels is very helpful for the some businessman. In the channel provided the all kinds of the information related the advertising. In the post is very important for the every visitor. keep it up.
    trolley wheels for sale

    Like 0 Short URL:
  • Guest (Dwayne Sammy)

    Excellent post here. A good stuff post always attract the other visitor on the internet. No doubt this post is contain a very good material here. Thank you very much for it and carry on it. suppliers list for horse mats

    Like 0 Short URL:
  • Guest (Marlon Brathwaite)

    There are very good points you have shared with us which are practically makes it work. These points are very helpful for us in practical life. Thanks for it and carry on it. heavy duty shelving for storage purpose

    Like 0 Short URL:
  • Guest (Jim)

    Very well written article about BBM Channels, you have written about it in simple words which makes it easy to understand. I must say you have made a great effort in making this post,keep writing more articles.
    get epdm rubber roofing here

    Like 0 Short URL:
  • Guest (jimmi)

    This is the best article about BBM Channels, you have made a great effort in making this article which is appreciable. I just want to say that you have complete knowledge of the subject.
    Purchase Tarpaulin Covers Online

    Like 0 Short URL:
  • Guest (Fredrick)

    I was on your website and reading your blog..I really like your post because it contains a lot of interesting information which I like the most. I am bookmarking your page for later use, so keep updating.
    business roll stickers for your product

    Like 0 Short URL:
  • Guest (James thomson)

    The bbm channels are the best social platform for connecting channels the black berry have introduced a great feature by introducing a bbm channels and thanks for providing a full coding with project. roadside assistance service

    Like 0 Short URL:
Subscribe to the official OSBB BBM Channel!

osbbchannelQR

C00013E89

Back to top