[Solved] How to show what other users have written to the app?

I’m not sure if you guys understand my title, but here is what I need.

I’m basically saying on how can I let users share what they have written to other user that use the app. Like for example sharing an idea to all the app users etc.

Please help guys.

Thanks.

1 Like

Basically you want to implement something like a chat app. This means you need to use a common data source such as Firebase and monitor a certain bucket in Firebase that stores user’s typed data.

Once any new data is saved, you will show it in the app to other users.

1 Like

What do you mean by this?

You can see the blocks for this in the Realtime DB documentation:

1 Like

Thanks for the info @tatiang, but when I look into my components tab, I can’t see Realtime DB. I think this is only for the Snap to Place. I am using the Drag and Drop. What can I use instead of the Realtime DB for Drag and Drop?

I don’t think the Drag & Drop interface has a listening block. I mean, it has this one for variables but I don’t think you can use it with Firebase:

image

You would have to use the Snap to Place interface.

2 Likes

Thanks a lot @tatiang, I guess I’ll find another solution

1 Like

Hi @codelover1234
You can use DnD to simulate a chat box.

You need to connect your project with a Firebase database by supplying API Keys and Database URL and then do something like this

image

The database key will be created automatically if not available.

If you start this very simple project from your computer and from your mobile at the same time you will see whatever you type in your computer will show in the mobile and vise versa.
https://x.thunkable.com/projectPage/61d18b1cff08e90011a5e6b9

2 Likes

Thanks a lot @muneer.

1 Like

Hi @muneer,
I’m having trouble trying to put the cloud variable into the list viewer.

Here is some images of the code:

Thanks.

1 Like

Hey @codelover1234

In your example, your blocks are trying to set a component that expects and array of strings to a single string. This wont work. The listViewers always expect an array/list of items, even when there’s only 1 item, it should still be applied in the form of an array.

Screen Shot 2022-01-06 at 10.09.51 AM

2 Likes

Thanks @Jared_Gibb

@Jared_Gibb, am I supposed to do it like this?

Can you tell me what is available in cloud variable shareIdeas?

Is it containing a list?
Or is it just a single text item?

1 Like

It is just containing a single text item @muneer.

1 Like

So your List Viewer will only show one single item and every time you update the Text Input and saved it back to the database you will be overwriting the existing data.

Is this what you want?

1 Like

I want to add text to the list viewer, not replace?

Could you fix this?

1 Like

See this example.
https://x.thunkable.com/projectPage/619b26462a8c5200388b8f38

1 Like

Cool! Thanks again @muneer!

1 Like

Though how do I do it with variables?

1 Like