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
Contributor
TheMarco33
Posts: 17
Registered: ‎02-18-2011
My Device: Not Specified
Accepted Solution

Registering with BBM

I'm trying to integrate BBM for the first time in a WebWorks app and I'm having a blocking issue. I can't seem to register. I have this code:

 

register: function () {
blackberry.event.addEventListener('onaccesschanged', function (accessible, status) {
if (status === 'unregistered') {
blackberry.bbm.platform.register({
uuid: '739ff5c5-20db-4f6a-849a-1572fc32cc1f'
});
} else if (status === 'allowed') {
bbm.registered = accessible;
}
}, false);
}

 

When I call this, nothing happens. I noticed that it adds an event listener to the 'onaccesschanged' event. But when in the world does that fire? I added an alert inside and I never get to see it when calling bbm.register() so no wonder it's not working.

 

What am I missing?

 

I'm using code from here:

 

https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/bbm/js/bbm.js

 

 

Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: Registering with BBM

Sorted it out. Code was right, I was calling it wrong.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Contributor
ryanruttan
Posts: 11
Registered: ‎09-01-2012
My Device: Z10 / PlayBook

Re: Registering with BBM

I too am having problems with this.  I used the code from the bbm example on GitHub (just like outlined in the first post), but I never get into the register code.  I am using the bbm.js from the example and I use the following when my application loads to try and register, but I hit the listener and that's all.  I can't figure out where to put the register call so that it actually works. Any help would be appreciated.

Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: Registering with BBM

Check out my open source app:

 

https://github.com/TheMarco/The-Last-Weather-App

 

You'll find the right way to use it in there.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Contributor
ryanruttan
Posts: 11
Registered: ‎09-01-2012
My Device: Z10 / PlayBook

Re: Registering with BBM

Thanks, that was a huge help and worked right away.

Developer
YoelyG
Posts: 26
Registered: ‎12-26-2012
My Device: Q10

Re: Registering with BBM

can some1 post the minimum code to do just the bbm connection (for a dummy :smileyhappy: )? i've played alot with the last weather app but couldnt figure it out..

Developer
YoelyG
Posts: 26
Registered: ‎12-26-2012
My Device: Q10

Re: Registering with BBM

got it after spending most of the day for it...