Last month, Mark Sohm showed us how to Invoke a BBM Channel Within Your App with QML. Well, not to be outdone by my fellow native development consultants, I’m here to show you how to do the same and more today, with WebWorks!

With the ever-growing popularity of BBM Channels, you’re probably looking for a way to integrate the service into your applications. Luckily, using the Invocation Framework, you can easily view a BBM Channel and share content to it. Let’s take a look at the JavaScript.

Invoking a BBM Channel

Here, we’re simply building our ‘request’ object by setting a target, action, and channel uri. Then, we’re calling the blackberry.invoke.invoke() method. If the user is already subscribed to the Channel it will open, if the user is not subscribed they’ll be prompted to do so. Note that the BBM Channel is case sensitive.

Sharing content

Below, is an example on how you would share a photo with a BBM Channel. Again, we’re just building our request object, giving it the path to a photo, and calling the blackberry.invoke.invoke() method. The Invocation Framework takes care of the rest!

You can also post text to a channel. It’s pretty much the same as the photo sharing, only you specify the mime-type and data properties instead of a photo uri.

Sample Apps

fried egg

Whether you’re developing with the latest BlackBerry WebWorks 2.0 powered by Apache Cordova, or the current WebWorks 1.0 SDK, there’s sample app for you! I’ve written two full samples that will show you how to add BBM Channels to your application.

Download the sample app for:

WebWorks 2.0 Beta
WebWorks 1.0 SDK

If you find this post useful, have questions or just want to keep up-to-date on the world of BlackBerry Development, follow me on Twitter at @chadtatro.


Read the article – 

Adding BBM Channels to your WebWorks App