0

Trying to get head around when debugging a Viewer app. Chrome console shows 'The provider id_provider is not a valid one'. Any suggestion? If options is like this:

        var options = {
            env: 'AutodeskProduction',                 
            getAccessToken: getToken } 
            }
         function getToken () {
            var response;
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
            if (xhr.readyState == 4 && xhr.status == 200) {
                response = JSON.parse(
                xhr.responseText);
                return response.access_token;
               }

if forcing 2.9, 'The provider id_provider is not a valid one'.

If forcing 2.7 or 2.8, not log but the viewer doesn't show up.

If no specified version, 'Warning : no access token is provided. Use built in token : YtTb8vRA4XQfTorjm9c8eVZJTYP6'. it stops in Autodesk360App.js

     var initialItem = app.getDefaultGeometry(geometryItems);

Chrome logs 'Uncaught TypeError: app.getDefaultGeometry is not a function'

If I directly feed token:

      accessToken: 'MorPwhKARIS3VGIrcd3FrZSjsnOx5'

it works beautifully in 2.7,2.8 and 2.9. But if no version, it stops in Autodesk360App.js, the same as above.

Thank you!

4

1 に答える 1

0

http リクエストのURLが抜けていませんか? 多分何か行:

function getToken() {
  var xmlHttp = null;
  xmlHttp = new XMLHttpRequest();
  xmlHttp.open("GET", '/yourTokenEndPoint', false);
  xmlHttp.send(null);
  var response = JSON.parse(xmlHttp.responseText);
  return response.access_token;
}

Viewerの場合は、同期する必要があります。

于 2016-08-20T11:42:31.017 に答える