MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
154 stars 67 forks source link

Access token not found #40

Closed AzharOfficialGitAccount closed 3 years ago

AzharOfficialGitAccount commented 3 years ago

Hi @MrHertal . I'm getting the errors regarding access token not found. I deployed the Twilio server-side web application followed by the Android SDK Quickstart. & I'm able to get all the things (TwiML application for the access token, access token for the quickstart, Push Credential using your FCM Server API Key), & also I followed the installation of the 3 modules (React Native CallKeep, React Native Firebase Messaging, React Native VoIP Push Notification). in root directory of the project. After that when I run the project, access token code I'm getting the error like this.. api response So I'm not getting the correct API endpoint for the access token so that Can I put here.. access token code So please help me regarding this issues, & also let me know what's the correct way to get the correct access token, so that can I make a call. so please help me regarding this issues. Thank You :)

MrHertal commented 3 years ago

Hi,

You need to replace the URL in the example (XXXXXX.ngrok.io) by the URL of the Twilio server-side web application that you deployed in order to fetch an access token.

AzharOfficialGitAccount commented 3 years ago

hi @MrHertal ,

I did the same, & currently, now I'm getting the access-token.

access-token

and I put the url of acces-token in the api call function in App.tsx

api call access-token

but still I'm not able to call. I've done the all steps & processes for deploying server. server deploy output

I got more url when I deployed the server, please see the below image

api call function

and I tried to put all the url in the api call function, and I tried to call Larry & Steve & also through varified number, I also tried to called the trail number. I did all the way to do this. but still when I make call, I'm not getting any response. so @MrHertal please help me regarding this issues, and give me the correct way to make a call. waiting for your response, please make a way to do this task. Thank you :)

MrHertal commented 3 years ago

Be careful you are publishing sensitive information. You should remove your deployed server now and create a new one.

Do you have access to the code that is deployed behind the /access-token endpoint?

The example in this library is based on this server side code: https://github.com/twilio/voice-quickstart-server-node/blob/master/src/server.js

AzharOfficialGitAccount commented 3 years ago

Hi @MrHertal, I did all the steps, I deployed the server from android-quick-start, not through the node. UI is working fine, also getting token response. but still when making call, not getting response. so Can you give me the right way to do this please. and I was not installed the React Native VoIP Push Notification. It's because I'm using for android, so is it mandatory to install the library in the files?. please give me the way to do this.

AzharOfficialGitAccount commented 3 years ago

Hi @MrHertal @, waiting for your response, please help me regarding this issues. I called the verified number from the trail number given by the twilio dashboard. I deployed twice time Server, but I'm getting same url for the access token. The call was sending, api token is generated successfully see the below access-token

I'm getting response from the access token url but still I'm not getting any response when I'm sending call. please give me the way how to do this, how to resolve it. Thank you, waiting for your response.

MrHertal commented 3 years ago

I have some difficulties to help you because I've never tried to deploy the server with the Twilio CLI, I used the old way which is installing this project: https://github.com/twilio/voice-quickstart-server-node

I will take some time to try the new Twilio CLI but I cannot tell you when.

AzharOfficialGitAccount commented 3 years ago

Hi @MrHertal , Thank you for your response. I also tried to using through the https://github.com/twilio/voice-quickstart-server-node, but still I'm not able to make a call. I deployed the server as I deployed the twilio-CLI for Android SDK Quickstart. I'm getting the server-node url. & I put the url of the acces-token in the api call function in App.tsx. as I previously put. but still I'm not getting any response. But when I deploying node-server I'm getting a api url which is given below the function name. so after that what's the way to do this. I think I'm doing mistake somewhere, so please help me what's the way to do this. Thank you, waiting for your response again :)

MrHertal commented 3 years ago

Hi, sorry cannot really help you because the problem could come from a lot of places.

I suggest you to start from the example app and run your own Twilio server (https://github.com/twilio/voice-quickstart-server-node).

Then you can try to apply these changes on the server: https://github.com/MrHertal/voice-quickstart-server-node/commit/03a07757f8973e03efa788e2342eaa9b7e1ebff5

I made these changes myself to improve the example app.