Javascript 如何在Skype web SDK中进行授权
最近发布了新Skype SDK的预览版。所以我下载了一些示例,阅读了MSDN文章,并尝试编写最简单的JS脚本来登录到这个SDK。所以,我从中提取了代码并对其进行了轻微修改(示例代码根本不起作用-使用了错误的变量)。修改后的代码可以工作,但返回错误:Javascript 如何在Skype web SDK中进行授权,javascript,skype,Javascript,Skype,最近发布了新Skype SDK的预览版。所以我下载了一些示例,阅读了MSDN文章,并尝试编写最简单的JS脚本来登录到这个SDK。所以,我从中提取了代码并对其进行了轻微修改(示例代码根本不起作用-使用了错误的变量)。修改后的代码可以工作,但返回错误: "TypeError: Cannot read property '1' of null at https://swx.cdn.skype.com/build2015/v5/SDK-build.js:8982:77 at handle (https:
"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);
});
});
我做错了什么 我终于找到了正确的答案:。悲伤但真实