Hi all. I got an 401 (Unauthorized) to all my asset url I’m using at approximately 16:00 26.10.2023 so all my HTMS / CSS ui fall a part. I’m using this to get urls console.log("url('https://playcanvas.com/api/" + this.printAssetURL["_file"]["url"]+"')");
is something changed today? I’ve tried on different internet connections and devices, same issue.
this is project example of how I use to get access to asset urls. Now it does not works and I seems figutred out. for some reason assets moved to new url and both this.myAsset.getFileUrl() and this.myAsset["_file"]["url"] return old url. My question is should I work around this issue by processing old url or issue will be fixed?
please use getFileUrl() to get asset URL, as documented, e.g. console.log(this.image.getFileUrl());
getFileUrl() returns correct URL for the launch page when you launch a project in the editor (launch.playcanvas.com), not main website (playcanvas.com).
Oh this is why… Thakns a lot. correct working cod looks like rule.style.backgroundImage = "url('https://launch.playcanvas.com" + this.iconAssets[iconIndex].getFileUrl() +"')";
be careful, because this script will work on the launch page, but will not work when you export your project and run it from your own server - these URLs should be relative.