我正在使用基于bbm的Phonegap为Android,IOS,Windows开发应用程序。
但是我找不到任何方法从设备中检索bbm引脚。
是否可以使用webworks api从设备检索bbm引脚?
答案 0 :(得分:2)
从WebWorks 2.0开始就可以。
要在项目中使用此API,请添加标识插件:
webworks plugin add com.blackberry.identity
并检查只读字符串blackberry.identity.uuid
更多信息:
https://developer.blackberry.com/html5/apis/v2_2/blackberry.identity.html
如果您的意思是uuid
与BBM平台(而不是Blackberry设备)相关,那么如果您考虑following code:
<script type="text/javascript">
// Create callback invoked when access changes
document.addEventListener("onaccesschanged", accessChangedCallback);
function accessChangedCallback(accessible, status) {
if (status == "unregistered") {
// App is unregistered, proceed to register
registerApp();
} else if (status == "allowed") {
// Access allowed
}
// Listen for other status...
};
function registerApp() {
// Register with the platform
blackberry.bbm.platform.register({
uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID
});
}
</script>
您可以看到,用于注册应用的uuid
只是随机生成的uuid
。当您调用registerApp时,为您的应用程序生成您自己的UUID,以便与BBM平台一起用作唯一标识符。
刚刚找到the following information:
每个应用程序都必须定义自己的通用唯一标识符(UUID),以便它可以唯一地标识自己。此UUID用于在测试和开发期间向BBM SP服务器注册。 BlackBerry App World™店面中的应用程序会自动分配自己的UUID。在BlackBerry WebWorks中,UUID存储在注册中使用的选项参数中。
options = {
uuid: "33490f91-ad95-4ba9-82c4-33f6ad69fbbc"
};
blackberry.bbm.platform.register(options);
在帖子下方有一个简短的讨论:
Q: can you please indicate where/how to find the AppWorld listed application UUID
A: That isn't visible to you. It's handled automatically.
Q: So how can we use the app's AppWorld UUID to register with BBM? Which was the context in which you mentioned the UUID.
A: In your code you always use your UUID you created. When the application is downloaded from App World the OS will automatically swap out your custom UUID with the one from App World.