0

enter image description here

I am creating an app that allows users to call each other in the app,l want to retrieve phone numbers from firebase auth and use them to make calls between users in my aoo.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
isheunesu
  • 3
  • 6

1 Answers1

2

Have a look at the FirebaseUser class documentation:

https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser

getPhoneNumber() or getDisplayName() shall give you what you are looking for.

Then, when you have the phone number, trigger the call this way:

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:0377778888"));
startActivity(callIntent);

See How to make a phone call in android and come back to my activity when the call is done?

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121