Please assign Cesium.Ion.defaultAccessToken with an access token

How can we fix this message warning?

I generated my own token and then tried the below code in order to get rid of this message, but it doesn’t work. I also tried pieces of codes found in other posts with similar issue, but none of them worked. Does anybody know how to fix this?

Thanks a lot

// Cesium access token
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1ZDdmZWViMS0xZDVjLTRhYTUtYWI4Yy0yOGFkZmI4YjNmZGIiLCJpZCI6NTI3ODIsImlhdCI6MTYyMjU1NTY4M30.2Qry6HDCock7YrMi8GQaStykhvfbCfuJ-TDs7IRglmY'

// Bing map api key
Cesium.BingMapsApi.defaultKey = 'AlAmEdB42aWYJak6UYpV_TmC9ZJVjYkSVRU3DqpMxemy5smDVdGRoJ5ye7147B0E';
// Construct the viewer with just what we need for this base application
var viewer = new Cesium.Viewer('cesiumContainer', {
	timeline:false,
	animation:false,
	vrButton:true,
	sceneModePicker:false,
	infoBox:true,
	scene3DOnly:true,
	terrainProvider: Cesium.createWorldTerrain()
});

// Add credit to Bentley
viewer.scene.frameState.creditDisplay.addDefaultCredit(new Cesium.Credit('<a href="https://wingtra.com/" target="_blank"><img src="https://539308-1724691-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/wingtra-logo-small-1.png"/></a>'));

// Create tileset. Do not forget to reduce the default screen space error to 1
var tileset = new Cesium.Cesium3DTileset({
	url: '../Scene/Production_2.json',
	maximumScreenSpaceError : 1
});

// Override behavior of home button
viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function(commandInfo) {
	// Fly to tileset
	viewer.flyTo(tileset);

	// Tell the home button not to do anything
	commandInfo.cancel = true;
});

// Add tileset to viewer and set initial camera position
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);

Hi @marketing-wingtra - welcome to the community forum! What fixes have you tried for this issue? Have you tried Omar’s suggestion in this thread?

Best,
Eli