Closed youcci closed 4 months ago
This is my NodeJS Server Code and i want to send the callback back to Flutter According to the node js socket io callback is a valid function: https://socket.io/docs/v4/emitting-events/#acknowledgements
Is there an implementation in Flutter to handle it?
socket.on('createRoom', async (callback) => { console.log('Create Room triggered') if (router === undefined) { router = await worker.createRouter({ mediaCodecs }) console.log('Router Created: ', router.id) } getRtpCapabilities(callback) }) const getRtpCapabilities = (callback) => { const rtpCapabilities = router.rtpCapabilities callback({rtpCapabilities}) }
This is my Flutter Code. i just want to test getting Data from the callback
socket.emitWithAck( 'createRoom', {}, ack: (data) { print(data); }, );
But when doing so i get an error on my server
callback({ rtpCapabilities }); ^ TypeError: callback is not a function
Can someone help?
it faced me too!
This is my NodeJS Server Code and i want to send the callback back to Flutter According to the node js socket io callback is a valid function: https://socket.io/docs/v4/emitting-events/#acknowledgements
Is there an implementation in Flutter to handle it?
This is my Flutter Code. i just want to test getting Data from the callback
But when doing so i get an error on my server
Can someone help?