【问题标题】:How to authorize in Skype web SDK如何在 Skype Web SDK 中授权
【发布时间】:2015-08-02 15:43:43
【问题描述】:

最近发布了新的 Skype SDK 的预览版。所以我下载了示例,阅读了 MSDN 文章并尝试编写最简单的 JS 脚本来登录这个 SDK。所以,我从这个MSDN article 中获取了代码并稍微修改了它(示例代码根本没有工作 - 使用了错误的变量)。修改后的代码有效,但返回错误:

"TypeError: Cannot read property '1' of null at https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8982:77 at handle (https://swx.cdn.skype.com/build2015/v5/SDK-build.js:2220:63) at https://swx.cdn.skype.com/build2015/v5/SDK-build.js:698:34". 

所以我的代码如下:

$(function () {
    'use strict';    // create an instance of the Application object;
    // note, that different instances of Application may
    // represent different users
    var Application
    var client;
    Skype.initialize({
        apiKey: 'SWX-BUILD-SDK',
    }, function (api) {
        Application = api.application;
        client = new Application();


        // when the user clicks on the "Sign In" button    $('#signin').click(function () {
        // start signing in
        client.signInManager.signIn({
            username: 'login',
            password: 'pass'
        }).then(
            //onSuccess callback
            function () {
                // when the sign in operation succeeds display the user name
                alert('Signed in as ' + application.personsAndGroupsManager.mePerson.displayName());
            },
            //onFailure callback
            function (error) {
                // if something goes wrong in either of the steps above,
                // display the error message
                alert(error || 'Cannot sign in');
            });
    }, function (err) {
        alert('some error occurred: ' + err);
    });
});

我做错了什么?

【问题讨论】:

    标签: javascript skype


    【解决方案1】:

    我终于找到了正确答案:for now Skype Web SDK is only for Skype for Business not Skype for consumers。悲伤但真实。

    【讨论】:

      猜你喜欢
      • 2015-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-08
      相关资源
      最近更新 更多