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
Trusted Contributor
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900
My Carrier: AT&T

Re: BB10 BBM Integration

I am having some problems. I have my .js fileready to go but when I launch the app imgot being questioned if I have registerd or not.

 

My index.html

 

 

<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="bbui-0.9.4.css">
<link href="css/xxx" rel="stylesheet">
<link href="css/dt.css" rel="stylesheet">
</head>
<body>

			<script src="js/jquery-1.7.1.min.js"></script>
			<script src="js/bbm.js"></script>
        	<script src="js/xx.js"></script>

<script type="text/javascript" src="bbui-0.9.4.js"></script>
<script type="text/javascript" src="webworks-1.0.2.9.js"></script>


<script type="text/javascript">

window.addEventListener('load' , function (e){
	
		document.addEventListener('webworksready' , function (e){
		bb.init({onscreenready : function(element, id, params) {
                         if (id == 'timer') {
	

                             
                        } 
                     },
					 
					 
         ondomready: function(element, id, params) {
                         if (id == 'timer') {
						
                        } 
						
                     }});
	
		bb.pushScreen('timer.html', 'timer'); registerBBM();
		}, false);
	}, false);
	</script>
</body>
</html>

 Now here is my .JS file

 

function registerBBM(){

// Create callback invoked when access changes
blackberry.bbm.platform.onaccesschanged = function(accessible, status) {
    if (status == "allowed") {
        // Access allowed
    } else if (status == "user") {
        // Access blocked by user
    } else if (status == "rim") {
        // Access blocked by RIM
    }
    // Listen for other status...
};

// Register with the platform
blackberry.bbm.platform.register({
    uuid: "3a4cff00-127e-11e2-892e-0800200c9a66" // Randomly generated UUID
});
}

 What am I doing wrong?

 

 

BlackBerry Development Advisor
Posts: 652
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: BB10 BBM Integration

Try moving the registerBBM() function to your ondomready like this

 

ondomready: function(element, id, params) {
    if (id == 'timer') {
       registerBBM();
    } 
}});

 

Trusted Contributor
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900
My Carrier: AT&T

Re: BB10 BBM Integration

I tried that and im still not getting any thing.

BlackBerry Development Advisor
Posts: 652
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: BB10 BBM Integration

I would try using Web Inspector then to see what's happening live on the device.  It could be a run time error, or something small that's not obvious.

 

https://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html

Trusted Contributor
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900
My Carrier: AT&T

Re: BB10 BBM Integration

[ Edited ]
BlackBerry Development Advisor
Posts: 652
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: BB10 BBM Integration

I'm wondering if it's even entering your registration function at all?  Maybe you could throw an alert in there, and see if it pops up as well.

 

Here's some sample code from a test app I made.

 

function setupBBM() {
	try {
		//Register the app and push the update profile page.
		var settings = {
			uuid: "9862cc20-c06f-11e1-afa7-0800200c9a66"
		};
		blackberry.event.addEventListener("onaccesschanged", changedCallback);
		blackberry.bbm.platform.register(settings);
	} catch (e) {
		alert('Error: ' + e);
		bb.pushScreen('bbm.html', 'bbm');
	}
}

 ..and the callback

 

function changedCallback(allowed, reason) {
    if (allowed) {
        alert('allowed!');
        // do more things here

	}
}

 

Trusted Contributor
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900
My Carrier: AT&T

Re: BB10 BBM Integration

Developer
Posts: 589
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: BB10 BBM Integration

BUMP.

Can a development advisor please post the complete source from the docs sample so that others can see how to implement the different BBM functions.

Thanks!
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB10 BBM Integration

Hi there, there should be a sample application for BB10 posted here soon (just waiting on Pull Request approval):
https://github.com/blackberry/BB10-WebWorks-Samples

I'll follow-up once it's available.

greenback, just to confirm though, is it a BBOS sample you're looking for?

 

Sergio, can we see your config.xml too?


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Highlighted
Trusted Contributor
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900
My Carrier: AT&T

Re: BB10 BBM Integration

yes you can,

 

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="1.0.0.0"
		id="simple"
		xml:lang="en">

  <name>HI</name>

  <rim:navigation mode="focus" />
  <feature id="blackberry.system.event" />
  <feature id="blackberry.app" />
  <feature id="blackberry.app.event"/>
  <feature id="blackberry.ui.dialog"/>


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

	
  <rim:splash src="images/screen.png" />
  <rim:splash src="images/port.png" />
  <icon src="images/icon.png"/>
  
 <author href="https://sergiosdesigns.com">Sergio Sandoval</author>
<!--
<feature id="blackberry.app.orientation">
    <param name="mode" value="landscape" />
</feature>
-->
  <content src="index.html"/> 

</widget>