how to send an otp to email using twilio in react-native - react-native

I have to send an otp to the user's email using twilio. Is there a proper way to do it? I cannot find any proper documentation aur blog telling me how to do it. I am working on react-native android project.

Twilio developer evangelist here.
The documentation for sending verification codes to an email address using Twilio Verify is here: https://www.twilio.com/docs/verify/email.
As #spicy.dll has mentioned, you should make the API requests to Twilio from a server you control and not from your React Native application. If you make requests from your React Native app you would need to embed the API credentials somehow, and a malicious user could decompile your application, extract your credentials and abuse your Twilio account.
So, follow the docs above, host the code that calls the API and your credentials on a server and make requests to that server from your application.

Related

Is there any API for okta verify app to get the access code or accept the push?

Use Case:
In our product, we are using okta verify as MFA. we need to automate the MFA process, where we need to get the access code and submit the code for verification or accept the push to complete the verification process.
Challenges:
Okta verify is sitting on Android or IOS, so we can not include the devices in our environment and make them work
Need:
Is there any API to get the access code or accept the push?
Did you try this ?
Okta SDK
They explain for Android and iOS how to include Okta identification in your app.

FCM get registration token via robot framework

I want to get generated registration token which generated by a client such as (Web JS, Android/IOS App...) via robot todo automation testing
I'm thinking to use mountebank to add JS SDK but not simple because related to grant notification permission issue (It's required to able to generate registration token)
Anybody have an idea to get that token via robot please share
Thanks in advance!!!
What is FCM?
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send messages at no cost.
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.
Using deprecated Google Cloud Messaging APIs? Learn more about how to migrate to FCM.
https://firebase.google.com/docs/cloud-messaging

Does Firebase Admin SDK have an API to send a SMS token to a user?

We have a mobile application and end users are authenticated via Firebase.
Current behaviour
While onboarding users, we register every user on Firebase with an email and a mobile phone.
Once the user is created on Firebase we the use the link generation API generateSignInWithEmailLink and send an email to the users.
Users click on the email from their mobile phone and it automatically launches the App.
Desired behaviour
Instead of sending an authentication link in the email, we would like to use the SMS token validation feature of Firebase
This is very easily down via a browser based application.
How do we implement such a feature that on Android/Ios?
Option
We provide a custom backend HTTP end point which gets called by the user
From this backend, we instruct the Firebase Admin SDK to send a new SMS authentication token to the have any endpoint which allows the back end to send a SMS authentication token to the end user's mobile.
Is this possible? At first glance, I could not find anything in the documentation.
Thanks
https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth
Firebase does not provide a generalized service for verification via SMS. You will have to find another service for that.

Is Firebase Cloud Messaging authentication necessary?

I have server in php with custom user authentication. I'm trying to create chat with Firebase, and after reading docs I'm still confused id I need to authenticate my users for Firebase, and if so should I do it with signInWithCustomToken?
Any other tips on how should I proceed are welcome. Thank you.
There is no need to authenticate users for them to receive FCM messages.
You do need to pass the FCM Server key to send messages to devices however. You can see an example of that in the Authorization header here: https://firebase.google.com/docs/cloud-messaging/send-message

Sending Push Notification To All People Who Have Enabled Notifications For My Progressive Web App

I am in the process of developing a new site and have decided to add progressive web app capabilities to the site. I have set it all up correctly and I can send push notifications to devices with whom I know the endpoint via FCM with a cURL command.
My question is how do you send one to all users who have enabled notifications on my site without knowing a list of all users unique endpoints.
If you are using the Firebase Cloud Messaging Web SDK you should be able to get the Firebase token and subscribe that token a topic using the server side API and then you can message the topic.
NOTE: This requires the use of the Firebase Web SDK to work. This is not supported with the raw Web Push API.