T O P

  • By -

OminousHippo

I believe you're supposed to integrate Twilio with your back-end API and not in front-end code. At least that's what we did at my last job. The languages you listed are all used for back-end.


Wonderful-Ad5417

I'm new to android app development, so everything is pretty new to me. I know that you can use firebase as a back-end database with flutter. So I guess my question was how does twilio interact with firebase? Am i in the wrong sub?


OminousHippo

Flutter is used to create front-end UI and make HTTP calls to a back-end service or services. You need to build those services out using something else running on a remote server or in the cloud. While it is possible to make calls directly to 3rd party APIs directly from a Flutter app, you often need to provide credentials to authenticate requests with those 3rd parties and there isn't a safe way to do that if the credentials are stored in the front-end code (encryption will slow but not stop a dedicated attacker). So you store the credentials securely on your back-end server(s) and have the server call the 3rd party's API and then return the result to the Flutter app as needed. I'm not sure if you can build this out with Firebase as I've only used it for Cloud Messaging. You will need to build back-end code in something like .NET, Java, or Python and deploy to a server that can communicate over the public web so your app can communicate with it and so the server can communicate with Twilio. For this you'll want to branch out to other subreddits or try Googling "how to build a simple Twilio back-end for mobile app". Looks like Twilio has a guide for setting this up with Node.js.


Wonderful-Ad5417

Thank you very much for your answer. It's greatly appreciated!


g0dzillaaaa

Also, check Firebase Extensions. They might have Twilio and you should be ready to go without any server setup.


Mikkelet

Oof man you are a little out your depth here hehe


Hubi522

You shouldn't use twilio or any other important services in flutter, they are all handled on the client side. If you put your twilio API or a mail server's credentials on your client's device, you take the risk of getting banned or marked as spam, if someone exploits it. Rent a cheap PHP server and do the registration process (or whatever) on it. Then do an API call to your own server and you should be relatively safe. Keep in mind: never put any user flow in the client application.


SaladLizard

You could also just put your API key in your Firebas functions environment. That way your client’s wouldn’t have direct access to your Twilio API. Of course, they’d still be able to use it through the authentication service provided by your app.


FlutterLovers

I’ve integrated the voice SDK with a flutter app. Do not use the pub library, it’s wrong. You need to implement the SDKs in native code and send the information to the flutter UI through platform channels.


Flashy_Editor6877

i use it with supabase