Signing up users using phone number react-native-firebase - react-native

I am working on an application that will sign up users based on their phone numbers. Everywhere I have read, there are articles regarding signing in users using their phone number. While researching for this I landed on a stackoverflow article itself that mentioned that the signInWithPhoneNumber() article will work for sign up when queried for first time, and will be used for sign in once the user is created as in this article What will happen if I sign in user using phone number without user creation in firebase?.
Going by this article, I wrote the following code to achieve my purpose
import auth from "#react-native-firebase/auth";
console.log("going to sign up with", numberToSend);
// numberToSned is the input number to which the message has to be sent
const confirmation = await auth().signInWithPhoneNumber(numberToSend);
I also set up a dummy number to test the feature.
But whenever this request is made my application shuts down by itself
Also I do not get any error on the console regarding this
So I wanted to ask is their a way to sign up users using their phone number in firebase with react-native?

As the link you describe (but didn't share) says: Firebase makes no distinction between signing up with a phone number or signing in with a phone number. The code for both cases is exactly the same, as shown in the documentation on Firebase phone authentication.

Related

WhatsApp Business api cloud: How do I register a Customer's phonenumber via api?

Currently, I am using WhatsApp Business api cloud on one of my web project, I would like to register a customer's phone number but via api instead through meta, developer platform like following:
"Here is the image to register customer's number in the meta developer platform"
I want do this:
(managing the phone numbers)
but via api, and later of that send the verification code via api as well.
If someone can help me , telling me if that is possible and sharing documentation or the endpoint I would appreciate it very much, I've been looking at the documentation and postman's examples for 2 days without any success.
I'm sorry I didn't share the pictures directly, it is my first question on Stackoverflow
Thanks in advance,
Greetings!
I guess you are using WhatsApp provided a test phone number in From, you need to read this, https://developers.facebook.com/docs/whatsapp/cloud-api/get-started#sent-test-message
Enter the recipient phone number you would like to message in the To field. Ensure the number is correct, and that you want to add it to your list of 5 possible message recipients —as you add phone numbers, follow the prompts on the screen to verify you have access to them. Once this number has been added, it cannot be removed from your list.
Note: This limitation is only for WhatsApp-provided test phone numbers. Real phone numbers that you register do not have a limit on the number of recipients.
You don't need to register receivers' phone numbers if you are using your own real business phone number in the sender's phone number.

Customize Firebase / Google Identity Platform Multifactor Authentication Confirmation Email

I have successfully and deceivingly easily added Firebase authentication for my web ap. I've found during my work that it's actually just a wrapper over the identity platform product from GCP. I've found this out while working on adding two factor authentication via phone for the app as well.
Everything works fine for the amount of complexity 2fa brings.
The problem I am now facing is that every time I enroll a user to the second factor, they get a horrendous automatically generated email which I just can't seem to understand where to change.
I know that transactional emails are a bit unwieldy in Firebase, so I fear the worse on customization, which is why I am asking:
Where do you change, or disable that email? I am already notifying the user their phone was validated and they just got the SMS on their phone, there is no need for another ugly notification.
That said, the documentation does say an email will be delivered upon running the multiFactoruser.enroll method, but not much else.
I've also found that the identity platform allows for programmatic enrollment via the admin SDK which is I guess my next plan if the email cannot be disabled.
This seems straightforward enough, but I'm wondering if it will also send a validation SMS or that is simply it, if the user adds a wrong phone, they will then be locked out of their account.

Empty POST request's body from Google Pay in program Loyalty Card

We faced with testing problem on the side Google Pay.
At the current stage, we get into the GPay only after Card registration on the side of our site, when after filling out the form user is redirected to the GPay page to create a new Card.
A Card is being created : we see it with the data that is entered into the form, but the GPay doesn't send any requests to our site. A special test environment from GPay is needed?
Google Pay's support service asks: "Are you receiving the POST from GPay when you attempt the enrollment flow from the app?"
How we can apply from GPay if we can't create a Card from GP at this stage?
The process of creating a Card is described in paragraph 1 (on the site side).
How to get into the GPay for enrollment at the testing stage?
Support service writes "When you submit your user details from GPay, it sends a POST request to your server so that when your page is displayed it contains the information from the user data form. "
As we pointed, at the current stage we can't send data from the GPay.
It was expected thatGoogle Pay's support service send a POST request to our site, but we don't see POST request's body. It is empty.
Therefore, we asked earlier, What internet service we can see it with?
They answered, as we understood, that we can see it by sending from GPay.
How to send it from the GPay, if at the testing stage we can only see
newly created cards and we don’t get any requests from GPay?
Is testing take place from GPay app?
If so, why don't we have an access?
We get a request POST, but with an empty request body.
The GPay has a lot of users with the Loyalty Card.
Someone has already come across this.
We didn't find such situations on the Internet.
How anybody have handled situations like this before?
How to create a new Card from GPay and see a POST request?
We do not have access to the class settings in the account. On Russian language, we do not see the callback feature, and on English technical support sends to us a screenshot - there are settings in the account. Could there be access rights issues?
To accoding with your link from paragraph 5 https://developers.google.com/pay/passes/rest/v1/loyaltyclass#discoverableprogrammerchantsignupinfo - we did not find the insert barcode /manually settings. Can you tell us where to find them?
At the moment, we can scan the barcode in GPay app(due to help of GPay support service ), but we do not receive a Post request after inserting bar code in GPay app.
Our Russian account settings looks like:
GPay support service see our account on English so:
We don't see these settings for barcode.
In accordance with the documentation https://developers.google.com/pay/passes/guides/overview/how-to/use-callbacks, we set up a callback feature, but we do not receive a post request in the format json (php):
$responseJson_str = file_get_contents('php://input');
$responseJson = '[' . $responseJson_str . ']';
$response = json_decode($responseJson, true);
var_dump( $response);
$file_server = "server_calback.log";
$fw = fopen($file_server, "a");
fwrite($fw, "POST " . var_export($response, true) . "\n");
fclose($fw);
What is wrong?
I show a screenshot with the request POST to our site
https://itcrk.icu/testcallback.php
from https://reqbin.com/
At the beginning of testing stage, we implemented signin / signup as you indicated in points 1-6. We did this functionality was not because we needed it, but thought that it was necessary for testing.
Then we wrote in support team that we need a barcode/manually, as users of other cards are used to. We were answered that we need settings in the account, we did not find them. Support team helped us to configure the barcode in the account of the Merchant Center - Google.We insert barcode in the GPay , but we don’t get json on the site. We assume a problem with access rights in the Merchant Center - Google. How do other cardholders usually set up a barcode in their accounts? We do not have access to the settings n the Merchant Center - Google, unfortunately. Support team writes that there should be access, but it does not.
It turned out that there are two ways to work with cards in the GPay. The first method is described in the documentation here https://developers.google.com/pay/passes/guides/enrollment-signin, the second method is to scan the card(barcode/manually) and use it as a card storage, but card data is not sent to the user’s server.
The Loyalty card is simply displayed in the GPay with its number(from barcode/manually) and that's all.
Sign up and enrollment are triggered from the google pay app: https://developers.google.com/pay/passes/guides/enrollment-signin
You will see post once a user goes into the Google Pay app and hits add pass then finds your program and hits sign up/ sign in.
See 1-2.
You have to use the account you provide to support team - its only visible for them for testing.
It may not be from Google. Google requests have the body with the user details.
Go to google pay app and sign in with user that is whitelisted by support to see the program. Hit add pass, then loyalty program then search for your program then hit sign up/ sign in and it will post to the endpoint defined here: https://developers.google.com/pay/passes/rest/v1/loyaltyclass#discoverableprogrammerchantsignupinfo
Let me also clarify enrollment and sign in. This is what a user sees, what the Google Pay app does and finally what a merchant needs to do:
Google Pay user navigates to passes tab in Google Pay App, hits "+ Pass":
Google Pay chooses which type of pass to add, hits loyalty for this example:
User searches and presses on the specific program they want to sign up for (theres a testing phase before it goes public, in which only accounts which you tell support team can see the program in google pay app):
User then fills out information to share and consents to share their information with this merchant, then they press continue.
Google Pay Then does a POST request with user info to endpoint defined here on the loyalty class by merchant: https://developers.google.com/pay/passes/rest/v1/loyaltyclass#discoverableprogrammerchantsignupinfo
Here is where merchant, yourself would have to be listening for POST to endpoint you defined in the setting mentioned previously and give user form to finish providing all details needed and then redirect to the JWT link to automatically save the pass.
See https://developers.google.com/pay/passes/partners/enrollment-signin for reference.
It turned out that there are two ways to work with cards in the GPay. The first method is described in the documentation here https://developers.google.com/pay/passes/guides/enrollment-signin, the second method is to scan the card(barcode/manually) and use it as a card storage, but card data is not sent to the user’s server. The Loyalty card is simply displayed in the GPay with its number(from barcode/manually) and that's all.

Allow user to choose how they receive forgot password code

Tried searching for this in Amazon's docs but couldn't come up with anything.
Assuming that both email and phone number are checked in the verification section of the user pool. If the client app wants to allow the user to choose how they receive the code (assuming they've forgotten their password) - how do we get Cognito to handle that? Is there a way of getting the forgotPassword method to select a route (email or SMS)?
From some early testing, it seems like it always goes one route if both are available. I do see that Amazon themselves have made this available on their site though, so hoping that it should be possible?
For this example, we can assume that we've got a verified email address and phone number for that user.
I am on the Cognito team. Currently the behavior is that if both phone number and email are verified, the code goes to the phone, hence phone number is given preference and there is no way to select where the code actually goes. However, we have heard this request in the past and I will add a +1 to the feature request on your behalf.

SMS Retriever API - phone picker source

Does Google's SMS Retriever API get the list of phone numbers from the SIM lines on the user's device (which means that it's similar to TelephonyManager), or from the user's Google Play account?
I'm the product manager at Google for this API. Yes, as of the latest version of Play Services, the Phone Selector shows both the phone number for the device from the TelephonyManager (if it can be parsed as as a valid phone number) as well as recent phone numbers for the active Google Accounts on the device.
This is not directly addressed from the docs but if we infer from this statement in the Obtain the user's phone number:
Often, it is the best user experience to use the hint picker to prompt
the user to choose from the phone numbers stored on the device and
thereby avoid having to manually type a phone number
we can deduce that SMS Retriever API gets the contacts from your device.
Update
Please look at #Steven Soneff's answer
The numbers are retrieved from Smart Lock for Passwords on Android. They are retrieved if the user already stored it using Smart Lock else they will be empty. You may also ask the user to store the number for future use-cases using Smart Lock for Passwords.