Not able to tag different user login to save user profile's data

yes, appreciate that

hi @TIMAI2,
i have sent you a google form request about my post here at Not able to tag different user login to save user profile's data - #22 by crispbytes
i really need your expertise on the problem i'm facing.
do i need to write here again for you?

If using Firebase Authentication, why not extend that and update the user profile with the additional information, then all you need to do is call back the profile and parse it to your form?

Hi @TIMAI2, how can I do that ya?
Can you guide me please. Thank you.

I am in the middle of working up an example. Contrary to popular opinion here, I do have a life outside of the community, so it may be a while yet...:wink:

yes sure, i will wait for your further guides...thank you very much

@crispbytes

Please try this example:

userProfilesBlank.aia (19.1 KB)

You will need to add your Firebase project APIKey, Firebase Project Url (with a / at the end) and Firebase Storage Project ID, in the variables provided.

The example will then allow you to:

  • SignUp a user with Firebase Authentication (email/password) and add profile information to the Firebase Realtime Database, with images (selected from Shared Storage) uploaded to Firebase Storage
  • SignIn a user, using Firebase Authentication (email/password)
  • View, Edit and Update User Profile Information using Firebase Authentication, Firebase Storage and Realtime Database
  • Profile Data for each user is stored under their UID, created when they sign up.
  • SignOut a user in the app (the user does remain signed into Firebase, until their 1 hour token expires, but as the developer you need to prevent any actions to the Firebase data, just as by signing in gives access to the profile)
  • No secure rules used on the realtime database data or on the Storage files

The example uses only the Firebase REST API and the web component(s)

The blocks are laid out in three columns to "mirror" the three above processes.

It is quite complex, with much back and forth between the app and Firebase, but on wifi (and with suitably sized images) the actions happen in a matter of / less than seconds.

I trust this is what you were after, and can apply it to your work

1 Like

hi @TIMAI2,

Thank you so much for your example and i do really appreciate it.
But i do have some questions regarding the Firebase Storage:

  1. Firebase Storage URL is this this kind: gs://supportapp-test1.appspot.com (its just a testing project, not a real one), but you mentioned ID and i'm bit confused here :thinking:
  2. The photo that has been uploaded and saved, but it appears in my Firebase Realtime Database it return this: https://firebasestorage.googleapis.com/v0/b/gs://supportapp-test1.appspot.com/o/not+found?alt=media&token=not found (its just a testing project, not a real one)

So, is there anything that I have mistakenly did? thank you. :pray: :pray: :pray:

is your Firebase Storage Project ID

###########################

To see the url for a file, select the file,

image

then on the right hand side, right click on the link (in the red rectangle) and copy the link address,

image

which will look like this:

https://firebasestorage.googleapis.com/v0/b/supportapp-test1.appspot.com/o/userProfiles%2FBenny_Hill.png?alt=media&token=750b83bf-bd2d-4130-8f10-3b35bec1ccde

This is the correct url

(The %2F is important!)

I forgot to mention, I did not apply any secure rules to the database or storage. The idToken for the signed in user is returned in the blocks, so additions to the blocks code need to be made for this to work.

hi @TIMAI2,

I have put "https://supportapp-test1.appspot.com/" as the storageURL, and tried to sign up as a new user.
Everything's fine except the picture that I have selected to upload during signup process.
In the Firebase Realtime Database it show like below;


(info above is in testing mode, not production mode)

So, is the idToken that you mentioned above that needs addition blocks code in causing the token not found in the Firebase Realtime Database?

Did you notice that there is no https:// or any ending / in the above ?

Did you see the full example url I provided:

hi @TIMAI2,

Sorry, my bad as I'm implying the network knowledge of https:// stuff in mobile development.
It turns out working as charm, you really can make things happen. Thank you.
About the secure rules for Firebase Storage, so i need to change current rules to this "allow read, write: if request.auth != null;", is it correct?

See here for firebase rules:

scroll down to the Storage section!

1 Like

Hi @TIMAI2,

Much appreciated for the links provided :pray: :pray: :pray:

Hi @TIMAI2,

Today I have been tried to blend in your sample blocks into my app but turns out have problems.
As you can see below, I tested with two signups, can be written in Realtime DB but token failed to be fetched.

Even with the token cannot be found, the profile picture still successfully uploaded to Storage.

Below is my aia file and kindly help to check if I have missed out somewhere or I did something wrong?
Somehow I have tried to follow every single blocks from your last sample, and got plus some with my own blocks.
MyIT_Support_App_Project1_Test.aia (401.6 KB)

Note: Your sample still working fine and perfectly.

Thank you very much. :pray: :pray: :pray:

At what point do you get "token cannot be found" ? Where does this message come from?

Hi @TIMAI2,

I assumed you are trying to say about this right?

hi @TIMAI2 ,
I found the error while I paste the latest screenshot. Let me try again.

@TIMAI2 u got me and finally can work. I'm such a blind dude.
thank you very much.