最近发布了新的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';
var Application
var client;
Skype.initialize({
apiKey: 'SWX-BUILD-SDK',
}, function (api) {
Application = api.application;
client = new Application();
client.signInManager.signIn({
username: 'login',
password: 'pass'
}).then(
function () {
alert('Signed in as ' + application.personsAndGroupsManager.mePerson.displayName());
},
function (error) {
alert(error || 'Cannot sign in');
});
}, function (err) {
alert('some error occurred: ' + err);
});
});
我做错了什么?