DEVELOPERS BLOG

Cross Platform Sharing with BBM

CODE SAMPLES / 02.05.15 / Mark Sohm
catBy Ped Xing from Austin, Texas, US (Flickr) [CC BY 2.0 (http://creativecommons.org/licenses/by/2.0)%5D, via Wikimedia Commons

BBM for BlackBerry 10 has long supported sharing from other applications using the BlackBerry 10 Invocation Framework.  This capability is now available on BBM for Android and iOS.  We have created a standard set of URIs that you can use cross platform to launch BBM via Android Intents, iOS App Extensions and of course the BlackBerry 10 Invocation Framework.  Support for these on BBM for Windows Phone will be available in the future.  Let’s take a look at what you can do.

Start a Conversation or Invite User to BBM

“bbmi://<PIN>” can be used to start a BBM conversation if the PIN is an existing contact.  If it’s not an existing contact the user will be prompted to invite the user to BBM.  This can be used from within an application or on a web page:  <a href=”bbmi://2100000A”>Start BBM Chat or Invite User</a>

If linking on a web page another alternative to this URL: “http://www.pin.bbm.com/<PIN>”.  It either opens BBM with the specified PIN selected or directs the user to download BBM if they don’t have it installed.

Sharing Text

“bbmi://api/share?message=Hello&userCustomMessage=The%20message” opens the BBM Contact picker for the user to select one or more contacts.  Once they do, a chat opens with a draft message pre-populated to send.  The user will need initiate sending of the message.  There are two parts to the message.  The message parameter is not editable by the user and is required.  The userCustomMessage parameter is optional and populates part of the message that the user is able to modify.  This URL could also be used in a web page:  <a href=”bbmi://api/share?message=Hello&userCustomMessage=The%20Message”> Share in BBM</a>

Here’s what it’ll look like using BBM for Android:

bbm ms

Mark Sohm

About Mark Sohm

Senior Technical Solutions Manager on the Solution Architects team.

Mark Sohm joined BlackBerry in 2003 and currently works as a Senior Technical Solutions Manager on the Solutions Architects team. Mark Sohm has been helping developers create applications using BlackBerry technologies for over 15 years, starting way back with the very first BlackBerry JDK on BlackBerry OS 3.6 through to BlackBerry 10 and now Android with BlackBerry Dynamics and Android Enterprise.