问题
I'm trying to check user's phone number on the server side with C++. Client side looks ok, but on the server side I can only decode JWT
from client and find out Firebase ID of the user, but of course this is not what I need.
I still need to know phone number of the user, and I understand that I can do this with user ID and Firebase admin SDK, but I can't find admin SDK for C++ or any web-API which I could use from everywhere. So, how can I know user's phone number from C++?
回答1:
There is no Firebase Admin SDK for C++.
What you could do is use Cloud Functions for Firebase to run the Admin SDK for Node.js on Google's servers and then expose what you need in a HTTP Function. You can then simply call this URL from your C++ code.
Just be sure to properly secure access to that HTTP endpoint, since otherwise you might be leaking sensitive information.
来源:https://stackoverflow.com/questions/45426837/get-users-phone-number-from-c-using-firebase