在 Android、windows、IOS 上使用 webworks sdk 获取 BBM Pin

get BBM Pin using webworks sdk on Android,windows,IOS

我正在使用基于 bbm 的 Phonegap 为 Android、IOS、Windows 开发应用程序。

但我找不到任何方法从设备中检索 bbm pin。

是否可以使用 webworks api 从设备中检索 bbm pin?

从 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 平台相关(不是黑莓设备 uuid),那么如果您考虑 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);

在 post 下面有一个简短的讨论:

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.

目前这是不可能的,现在 BBM 不提供这样的 API 可能在未来的版本中他们会提供