12-04-2012 11:38 PM - edited 12-04-2012 11:41 PM
I'm using the simulator with webworks. I simply call the register method but nothing happen:
blackberry.event.addEventListener("onaccesschanged ", _bbm.test);
options = {
uuid: "aaa90f91-ad95-4ba9-82c4-33f6ad69aaaa"
};
blackberry.bbm.platform.register(options);
The callback method is never called....
This code is from:
https://github.com/blackberry/BB10-WebWorks-Commun
Also, this is the config file:
<rim:permissions> <rim:permit>bbm_connect</rim:permit> </rim:permissions> <feature id="blackberry.app" /> <feature id="blackberry.ui.dialog" /> <feature id="blackberry.bbm.platform" />
Solved! Go to Solution.
12-05-2012 07:07 AM - edited 12-05-2012 07:12 AM
Try the code from https://developer.blackberry.com/html5/apis/blackb
After changing this typo BBM works now in my app, while the code from the sample didn't work in my app (although the sample itself worked when installed)
12-05-2012 11:03 AM
Nothing happen! I also tried directly assigning the callback function.
blackberry.bbm.platform.onaccesschanged = function (accessible, status)
{
alert("testaccesschanged");
};
And calling the register function after...
var options;
/* A valid, unique, 36-character UUID is being used. */
options = {
uuid: "33490f91-ad45-4ba9-82c4-33f6ad69fbbc"
};
/* Call the register function with our UUID. */
alert("going to register");
blackberry.bbm.platform.register(options);Do I need to use the controller to connect to BBM Server? When I did it, nothing happen too...?
12-05-2012 11:45 AM
The documentation says:
During registration, a dialog opens and guides the user through the registration process.
This is my test. In fact, de dialog never open.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BBM</title>
</head>
<body>
<script type="text/javascript" src="local:///chrome/webworks.js"></script>
<script type="text/javascript">
function accessChangedCallback(accessible, status) {
alert("yeh!!!");
}
function onwebworksready() {
document.removeEventListener('webworksready', onwebworksready, false);
alert("webworksready");
blackberry.event.addEventListener("onaccesschanged ", accessChangedCallback);
var options = {
uuid: "33490f91-ad45-4ba9-82c4-33f6ad69fbbc"
};
blackberry.bbm.platform.register(options);
alert("registering...");
}
function onload() {
window.removeEventListener('load', onload, false);
document.addEventListener('webworksready', onwebworksready, false);
}
window.addEventListener('load', onload, false);
</script>
</body>
</html>
This is my config file:
<?xml version="1.0" encoding="UTF-8"?> <!-- * Copyright (c) 2012 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at: * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. --> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0.895" id="bbmsample" xml:lang="en"> <!-- Application details. --> <name>BBM Sample</name> <author>Research In Motion</author> <!-- Application startup page. --> <content src="index.html"/> <!-- Application icon. --> <icon src="appicon.png" /> <!-- Allow access to external URLs. --> <access uri="*" subdomains="true" /> <!-- Do not cache content. --> <rim:cache disableAllCache="true" /> <!-- Focus-based navigation for BBUI.js. --> <rim:navigation mode="focus" /> <!-- Required permissions. --> <rim:permissions> <rim:permit>bbm_connect</rim:permit> </rim:permissions> <!-- Required features for BBUI.js. --> <feature id="blackberry.app" /> <feature id="blackberry.app.event"/> <feature id="blackberry.system.event" /> <feature id="blackberry.ui.dialog" /> <!-- Additional features. --> <feature id="blackberry.bbm.platform" /> </widget>
12-05-2012 01:32 PM - edited 12-05-2012 01:33 PM
have you referenced these scripts in your html document?
bbui-0.9.4.js
bbm.js
12-05-2012 01:57 PM
12-06-2012 01:11 PM
The BlackBerry 10 Dev Alpha simulator does not currently support BBM. We are working on adding BBM support to the simulator. For now you'll need a real device to test on.