twilio / twilio-voice-react-native

Other
72 stars 27 forks source link

callinvite not working #340

Closed shubham-pal-clecotech closed 1 month ago

shubham-pal-clecotech commented 6 months ago

Hii i have registered the token successfully but after the register when i use voice.on("callInvite", (callInvite) => { console.log("callInviteMethod",callInvite); this.setState({ callInvite: callInvite }); }); i am not getting console and outside this when i console my state value i am getting null because i have set it's initial value null in state

const response = await fetch(
   "https://active-sunny-loon.ngrok-free.app/twilio/twilio_numbers/get_mobile_app_token? 
    id=16313520090&push_credential_sid=CR94014b9797f27bfb4e06990ae524c543"
      );
      console.log(response, "response");
      const accessToken = await response.json();
      console.log(accessToken, "accessToken");
      token = accessToken.token;
      const register = await voice.register(accessToken.token);
      console.log("registeredc", register);
      voice.on(Voice.Event.RegistrationFailed, (e) => {
        console.log("Registration Failed", e);
      });
      voice.on(Voice.Event.Registered, () => {
        console.log("Registered");
      });
      voice.on("callInvite", (callInvite) => {
      console.log("callInviteMethod", callInvite);
        this.setState({ callInvite: callInvite });
      });
mhuynh5757 commented 6 months ago

Hi @shubham-pal-clecotech please format your code, it's hard to read it when it's not formatted properly. You can format code by surrounding it with triple-backticks.

Also, please fill out the whole issue description and do not override the contents of the template. It helps us tremendously with debugging your issue. For example, I don't know what platform you're on.

mhuynh5757 commented 1 month ago

Hello, closing this issue as stale for now. Please feel free to reach out if you need further assistance.