简体   繁体   English

如何在Skype Web SDK中进行授权

[英]How to authorize in Skype web SDK

Recently preview version of new Skype SDK has been released. 最近发布了新的Skype SDK的预览版。 So I've downloaded samples, read MSDN articles and tried to write simplest JS script to make login to this SDK. 因此,我下载了示例,阅读了MSDN文章,并尝试编写最简单的JS脚本来登录此SDK。 So, I've taken code from this MSDN article and slightly modified it(sample code hasn't been working at all - used wrong variable). 因此,我从MSDN这篇文章中获取了代码,并对它进行了一些修改(示例代码根本无法正常工作-使用了错误的变量)。 Modified code works, but returns error: 修改后的代码有效,但返回错误:

"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". 

So my code is below: 所以我的代码如下:

$(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);
    });
});

What am I doing wrong? 我究竟做错了什么?

Finally I've found right answer: for now Skype Web SDK is only for Skype for Business not Skype for consumers . 终于,我找到了正确的答案: 目前,Skype Web SDK仅适用于Skype for Business,不适用于消费者 Sad but true. 悲伤但真实。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM