sketchAPI Library.getRemoteLibraryWithRss() errors on 97.x

when i follow the js API about Library, get an errors like this.

MacOS: 12.6.7
sketch Version: 97

Errors:
Error Domain=NSURLErrorDomain Code=-1002 “不支持的URL” UserInfo={NSUnderlyingError=0x60001c6844b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 “(null)”}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <0946FC7B-0698-4017-80F2-398275611747>.<24>, _NSURLErrorRelatedURLSessionTaskErrorKey=( “LocalDownloadTask <0946FC7B-0698-4017-80F2-398275611747>.<24>” ), NSLocalizedDescription=不支持的URL}
SketchAPI_dom.js:1:146643

here is my code eg:
let path = http://x.x.x.x/urlname/xx.xml
Library.getRemoteLibraryWithRSS(path, (err, library) => {
if (err) {
console.log(‘getRemoteLibraryWithRSS err:’,err);
}
});

Is this a sketchAPI error?
Looking forward to your reply,Thanks!

This error suggests that you’re providing an unsupported URL for the remote library when calling the API function.

As a reminder: all URLs you access with Sketch API must use HTTPS protocol, and I see plain “http://” in your code.

1 Like

OK, It seems that I must apply for an HTTPS certificate to make up for the problems caused by previous laziness.

Thanks for your help!

1 Like