Hi All, i have the need to work with firebase database, i came across the FireBase Auth tutorial which allows us to authenticate users using Google or Facebook.
The only thing i don't see is how to get the Token Id, i am using the Rest API for firebase database, i have created a database but it requires me to pass a token id in order for me to be able to insert and read data from the database.
Is there a way to retrieve the token id from the iFireBaseAuth library after the user has been authenticated? If so, how would I be able to do this, i have not been able to find anything in the forums.
I found this code in the documentation in Objective C, but not too sure how to use it using Inline Objective C, can I get some help from the experts, I've tried doing it on my own but get lots of errors.
Thanks in advance.
Walter
The only thing i don't see is how to get the Token Id, i am using the Rest API for firebase database, i have created a database but it requires me to pass a token id in order for me to be able to insert and read data from the database.
Is there a way to retrieve the token id from the iFireBaseAuth library after the user has been authenticated? If so, how would I be able to do this, i have not been able to find anything in the forums.
I found this code in the documentation in Objective C, but not too sure how to use it using Inline Objective C, can I get some help from the experts, I've tried doing it on my own but get lots of errors.
Retrieve TokenID:
FIRUser *currentUser = [FIRAuth auth].currentUser;
[currentUser getIDTokenForcingRefresh:YES
completion:^(NSString *_Nullable idToken,
NSError *_Nullable error) {
if (error) {
// Handle error
return;
}
// Send token to your backend via HTTPS
// ...
}];
Thanks in advance.
Walter