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

Web and WebWorks Development

Reply
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi
Accepted Solution

Steps for BBM on Webworks

I'm trying to set up BBM with my webworks applications. I just want to get to the point where I can successfully run the register function.

 

These are the steps I've completed...

 

1. Added the following to my config.xml file...

 

<rim:smileytongue:ermissions>
<rim:smileytongue:ermit>bbm_connect</rim:smileytongue:ermit>
</rim:smileytongue:ermissions>

 

2. Added the bbm.js file to the html file.

 

3. Added an onclick event to trigger the following to trigger the event.

 

<a href="#" onclick="_bbm.register();">BBM</a>

 

 

What am I missing here?

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Steps for BBM on Webworks

Are you also handling the callback from the registration?  You can see a sample application here:

 

BBM WebWorks Sample

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.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Steps for BBM on Webworks

I took the bbm.js file from the sample you posted. Wouldn't the callback be handled there?
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Steps for BBM on Webworks

What problem are you having?

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.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Steps for BBM on Webworks

When I click on <a href="#" onclick="_bbm.register();">BBM</a>

I get back the following in web inspector

ReferenceError: Can't find variable: _bbm
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Steps for BBM on Webworks

If you are using bbm.js as is the variable is bbm, not _bbm.

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.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Steps for BBM on Webworks

Thanks, not sure where I got the '_' maybe I from an older example on Github.

It's still working, nothing happens. (Well sometimes it glitches the app and I get big blue chunks on the screen).

Could I email you the app to take a look at? It's pretty simple as it's only a small part of a larger app I'm working on for testing BBM.
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Steps for BBM on Webworks

Can you make sure you're using the latest version for the BlackBerry WebWorks SDK and are using the most up to date webworks.js file?  Older versions won't have the updated BBM registration code.

 

In WebWorks SDK v1.0.4.5, the way you reference the webworks.js file changed to this:

 

<script src="local:///chrome/webworks.js"></script>

  

https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/bbm/index.html#L27

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.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Steps for BBM on Webworks

Yep I'm using the latest version and the correct way of linking webworks. Going to remove all other code in my example to make sure nothing is interfering and then post a DropBox link.
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Steps for BBM on Webworks

[ Edited ]

This is now fixed.

 

Problem was even though I asked for permission to use BBM I didn't add the feature tag in the config file. 

 

<feature id="blackberry.bbm.platform" />

 

Noob mistake.

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.