Cocos creator support async methods?

Hello I was looking at this async.
But I found for example.

    delay(ms: number): Promise<void> {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

Works on some devices, but not on all the devices.

Basically my async method is

private async RestartGame ()
    {
        //count gameplay
        let countGamePlay = localStorage.getItem("countGamePlay");
        if (countGamePlay == null)
        {
            localStorage.setItem("countGamePlay", "0");
        }
        let count = parseInt(localStorage.getItem("countGamePlay"));
        count++;      
        let isAdReady = AndroidNative.isInterstitialReady();       

        if(count>=3)
        {      
            AndroidNative.showToast("Show Interstitial Game.ts",0)
            AndroidNative.showInterstitial();//

            // await this.delay(1500);//Doesn't work on all devices, not safe.
            director.loadScene("Game");
        }        
        else
        {
            AndroidNative.showToast("Count " + count.toString() , 0);
            localStorage.setItem("countGamePlay", count.toString())            
            director.loadScene("Game");
        }      
    }

But while it works fine on the editor and some devices I found this is not safe.
I wonder if this is officially supported ? Maybe other way to do this ?

I think you need to learn how async/await (promise) work, first. Modern JS/TS already support promise natively.

Your problem could be due to “this” instance. The “this” instance that you are referring could be already referencing to another object when you called that function. To fix that you need to bind the object while calling the function.

OR, an easy way would be, just use setTimeout

setTimeout ( ()=>{
      director.loadScene("Game");
}, 1500)

await this.delay(1500);
this.scheduleOnce(()=>director.loadScene(“Game”), 0);
;