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
Gerii
Posts: 33
Registered: ‎04-30-2012
My Device: PlayBook, DevAlpha
My Carrier: 3AT
Accepted Solution

Can't register with BBM on DevAlpha

[ Edited ]

I'm trying to make my app BBM connected, but I can't even register my app with BBM. I'm using PhoneGap/Cordova and the jQueryMobile BB10 theme in my app. I have also linked WebWorks to my app and can create calendar events with it. 

I have added

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

 and

<rim:permissions>
  <rim:permit>bbm_connect</rim:permit>
</rim:permissions>

 to my config.xml.

The BBM demo from https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/bbm works fine on my device and I can use BBM to chat with others.

This is the error I get when trying to register my app:

TypeError: 'undefined' is not a function (evaluating 'blackberry.event.addEventListner('onaccesschanged', accessChangedCallback)')

 

I alredy tried to make my app BBM connected with the 1.0.2.x SDK but this also didn't work (I didn't get an error, it just didn't do anything).

 

And this is my current code (using the latest (1.0.3.8) SDK):

$('[data-role="action"]').bind("vclick", function () {
	if (this.id == "recommendTourViaBBM") {
		// Create callback invoked when access changes
		blackberry.event.addEventListner('onaccesschanged', accessChangedCallback);
	}
});

function accessChangedCallback(accessible, status) {
    if (status == "unregistered") {
		// App is unregistered, proceed to register
		registerApp();
	} else if (status == "allowed") {
		console.log("allowed");
		// Access allowed
	}
    // Listen for other status...
};

function registerApp() {
// Register with the platform
	console.log("trying to register");
	blackberry.bbm.platform.register({
		uuid: "**********" // Randomly generated UUID, http://www.guidgenerator.com/online-guid-generator.aspx
	});
}

 

 

 

Please use plain text.
Trusted Contributor
usr501
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: Can't register with BBM on DevAlpha

[ Edited ]

i had it working with 1029 after the upgrade to 1038 i can register but can't invite.

definitley going to webinar this coming Thursday at 11am EST for BBM connected apps :smileyvery-happy:

 

I dumped both scripts (  first was  similar to code you show, second was the contents of the bbm.js file) into the body of my bbm .html page 

bbmca.png 

Please use plain text.
Developer
colforbin13
Posts: 28
Registered: ‎03-21-2011
My Device: Torch 9800
My Carrier: AT&T

Re: Can't register with BBM on DevAlpha


Gerii wrote:

I'm trying to make my app BBM connected, but I can't even register my app with BBM. I'm using PhoneGap/Cordova and the jQueryMobile BB10 theme in my app. I have also linked WebWorks to my app and can create calendar events with it. 

I have added

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

 and

<rim:permissions>
  <rim:permit>bbm_connect</rim:permit>
</rim:permissions>

 to my config.xml.

The BBM demo from https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/bbm works fine on my device and I can use BBM to chat with others.

This is the error I get when trying to register my app:

TypeError: 'undefined' is not a function (evaluating 'blackberry.event.addEventListner('onaccesschanged', accessChangedCallback)')

 

I alredy tried to make my app BBM connected with the 1.0.2.x SDK but this also didn't work (I didn't get an error, it just didn't do anything).

 

And this is my current code (using the latest (1.0.3.8) SDK):

$('[data-role="action"]').bind("vclick", function () {
	if (this.id == "recommendTourViaBBM") {
		// Create callback invoked when access changes
		blackberry.event.addEventListner('onaccesschanged', accessChangedCallback);
	}
});

function accessChangedCallback(accessible, status) {
    if (status == "unregistered") {
		// App is unregistered, proceed to register
		registerApp();
	} else if (status == "allowed") {
		console.log("allowed");
		// Access allowed
	}
    // Listen for other status...
};

function registerApp() {
// Register with the platform
	console.log("trying to register");
	blackberry.bbm.platform.register({
		uuid: "**********" // Randomly generated UUID, http://www.guidgenerator.com/online-guid-generator.aspx
	});
}

 

 

 


Assuming this is a direct copy of your code, I see a typo that could be causing the error.  You have "blackberry.event.addEventListner" when it should be "blackberry.event.addEventListener" - you're missing an "e" in Listener.

------------------------------------
Twitter: @ChiSoxRunner
Script. Bake. Run.
Please use plain text.
Contributor
Gerii
Posts: 33
Registered: ‎04-30-2012
My Device: PlayBook, DevAlpha
My Carrier: 3AT

Re: Can't register with BBM on DevAlpha

[ Edited ]

Thanks, that was the issue - as I directly copied the code from https://developer.blackberry.com/html5/apis/blackberry.bbm.platform.html , I assumed that it should work. Although that's not the first typo I have seen there so I should have known better.

Hopefully someone from RIM will fix the documentation error soon.

 

@usr501: Even blackberry.bbm.platform.users.inviteToDownload(); works for me now.

Please use plain text.
Trusted Contributor
usr501
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: Can't register with BBM on DevAlpha

[ Edited ]

@gerii

what else is BBM connected app supposed to do?

i couldn't invite with NFC

could invite from button link

do chat bubbles appear in app?

i'm experiencing  this now:

 

BBM has lost its connection,

Please wait while server

attempts to reconnect.  :Beta1:

Please use plain text.