Start a new topic

Wikitude JS Sdk for android

Do wikitude js sdk support async-await function or it is compatible with these syntax ?

It is supported in browsers.

but when i run application it is throwing error:

Uncaught SyntaxError: Unexpected token


testApi: async function tetsApiFn(){
console.log("test api");
var response=await fetch('https://randomuser.me/api?results=10&seed=hi&page=1');
var myJson = await response.json();}

Hi,


I just tested the following:


var test = async function(){console.log("test")};
test();


This worked for me without any issues. Since we rely on the WebView implementation installed on the phone it could be that the Android System WebView or Chrome are outdated and do not support this. 


Please also make sure that the error is not caused by some other code.


Best Regards,

Alex

I ran some code to detect which browser it is using on mobile

I got result safari version 4.


My question is it is varies from device to deivce ? If it would be case then i guess some broswers doesn't support all syntax.

And this code was working fine on real broswer , can you please elaborate this case ?





Login or Signup to post a comment