如何从firebase检索数字并使用它们允许用户互相呼叫

时间:2018-03-31 16:37:53

标签: android firebase firebase-authentication

enter image description here

我正在创建一个允许用户在应用中互相呼叫的应用,我希望从firebase auth中检索电话号码,并使用它们在我的用户之间拨打电话。

1 个答案:

答案 0 :(得分:2)

查看FirebaseUser类文档:

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

getPhoneNumber()getDisplayName()会为您提供所需内容。

然后,当您有电话号码时,以这种方式触发呼叫:

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

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