Tuesday, June 7, 2022
HomeGame Developmentblob.arrayBuffer shouldn't be a perform - Cocos Creator

blob.arrayBuffer shouldn’t be a perform – Cocos Creator


Hello everybody.
I would like to make use of WebSocket to speak with my server-side. Every thing works properly within the browser, however I’ve ‘blob.arrayBuffer shouldn’t be a perform’ in ios.
Right here is my code:

    public async onSocketMessage(occasion) {
        let blob = occasion.knowledge as Blob;
        const buffer = await blob.arrayBuffer();
        const uint8ArrayNew = new Uint8Array(buffer);
        this.parseMessage(uint8ArrayNew);
    }

My server-side sends a Blob knowledge sort, then I would like parse this blob to a response object. Please assist me repair this downside. Is there some other means ?
Thanks a lot.


My mistake , occasion.knowledge is ArrayBuffer.
Thanks.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments