Why addResponseListener callback not work?

Options
It's right to get response data in ResponseListener's callback function ? Or I think wrong ?

here is my code :
const addListener = (client) => {
    client.addResponseListener(CODE,(e) => { console.log('addResponseListener callback',e.data) } );
}
But nothing in console QAQ

Comments

  • ytk
    Options
    It just only sendOperation now.
    I have no idea about how to get response data. :'(
    Could someone give me a hand please ~
  • ytk
    Options
    I found the anwser :#
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @ytk,

    Thank you for choosing Photon!

    Please share the solution with us so others can benefit from it.
  • khubaib
    Options
    ytk said:

    I found the anwser :#

    Hi, kindly share the solution with us so that we can also benefit from it :smile:
  • vadim
    vadim mod
    edited March 2018
    Options
    addResponseListener is a part of PhoonPeer api. While having realtiime and chat apis based on it, you hardly need to use PhoonPeer api directly.

    Probably the reason was that instead of registering callback, the code assigns function which registers callback to constant. No call actually done.