# Firebase real time chat issues

**URL:** <https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273>\
**Category:** Web API's\
**Tags:** firebase, beginner, realtimedb\
**Created:** [June 25, 2022, 8:27pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273 "2022-06-25T20:27:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 25, 2022, 8:27pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/1 "2022-06-25T20:27:15Z")

</div>

Hey thunkers,am having issue displaying text inputs in my chat app, with the real-time adlistener in firebase…  
This app uses the real-time adlistener component,and of which a key associate users to see text entered.  
But unfortunately it’s not working for me.  
think I might have mixed things up, please help

 ![Screenshot_20220625-211400~2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/e/aeedd7a40f714d4cfea444ac82474b953c5a3b5e.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 26, 2022, 7:01am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/2 "2022-06-26T07:01:47Z")

</div>

Why do you have a blank “if” block at the top?

Also, “it’s not working for me” is not enough details for us to help you… what do you expect to happen when you do [some action] and what actually happens?

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 26, 2022, 7:28am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/3 "2022-06-26T07:28:50Z")

</div>

The blank if block was meant to -do nothing if text input=undefined or null…  
So the normal result should be…when a text is entered at the click of the send button,the Real-time DB should get update and display the text in either the Left or Right Output label depending on who’s texting,just like the normal chat app…  
Thanks for your response

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 26, 2022, 7:44am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/4 "2022-06-26T07:44:40Z")

</div>

Here’s the link to the app sample for a review-  
[https://x.thunkable.com/copy/0a07e1981bad3ef760107a5f0c277654](https://x.thunkable.com/copy/0a07e1981bad3ef760107a5f0c277654)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 26, 2022, 1:56pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/5 "2022-06-26T13:56:19Z")

</div>

An `if` block without a condition is going to be unpredictable. Or perhaps it isn’t… perhaps it will always be TRUE or always be FALSE. Regardless, it’s not a good way to program. Just remove that `if` block.

You’ve explained what _should_ happen but not what _does_ happen when you preview the app.

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [June 26, 2022, 4:58pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/6 "2022-06-26T16:58:48Z")

</div>

An if statement without a conditions breaks, it will never go to the else statement. It faults out. In actually programming it will throw a syntax error. (i think thats the right error) Try adding a condition to the if statement.

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 27, 2022, 4:11am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/7 "2022-06-27T04:11:41Z")

</div>

I’ve made an adjustment to it,but yet nothing works

 ![Screenshot_20220627-050626](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/2/c28aa711011476dc5755934c40cd417aa542dd07.png)  
 ![IMG-20220627-WA0000](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/a/aa242ef4675fe0794c92115a94140008dee78e03.jpeg)

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [June 27, 2022, 4:25am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/8 "2022-06-27T04:25:11Z")

</div>

Have you been able to successfully send a message at all? If not i would start there before trying to do clones and such. Whenever i run into an issue, i start with the basic components needed then work my way up

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 27, 2022, 4:38pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/9 "2022-06-27T16:38:40Z")

</div>

It’s nothing working either,can somebody just please help me out on this…  
I want a chat room where by users can join using the key served ,and I will humbly it to be a clone not in a listviewer type.🙏🙏🙏

---

<div class="post-metadata">

**Author:** ![zander](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zander](https://community.thunkable.com/u/zander)\
**Post date:** [June 28, 2022, 2:35am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/10 "2022-06-28T02:35:42Z")

</div>

So I finally clicked on your project, I don’t think you have the rtdb database or api key in there. I put mine in and was able to post a message to the chat and have it show up in my rtdb. Scroll down until you see firebase settings. Then follow the instructions [here.](https://docs.thunkable.com/realtime-db)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/d/7d9a010653269f60870ec3739c055ee768b7e9b1.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/afe55feee1fa7a196288f4ca77029d8a15fef210.png)

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 28, 2022, 3:08am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/11 "2022-06-28T03:08:00Z")

</div>

thanks,i will check that out

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 28, 2022, 3:50am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/12 "2022-06-28T03:50:44Z")

</div>

> [@zander](#):
>
> I don’t think you have the rtdb database or api key in there.

This might not be the case at all.

When you copy a project from another account, Thunkable removes sensitive data from the project such as API keys.

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 28, 2022, 5:08am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/13 "2022-06-28T05:08:55Z")

</div>

The result is same, inputs are not showing up

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 29, 2022, 2:40pm UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/14 "2022-06-29T14:40:29Z")

</div>

I think there is a problem with the Real-time DB,the rules are on "now…any idea on what should be done!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 30, 2022, 9:43am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/15 "2022-06-30T09:43:03Z")

</div>

> [@versatile](#):
>
> rules are on "now…any idea on what should be done!

Can you clarify?

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 30, 2022, 9:58am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/16 "2022-06-30T09:58:59Z")

</div>

That’s been resolved @muneer ,but that has brought me into another phase to advance the chatting stuff…  
I don’t want chat records to clear after users exit the chat screen…I want to them to be able to still see previous and current conversations in the chat room…

---

<div class="post-metadata">

**Author:** ![versatile](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@versatile](https://community.thunkable.com/u/versatile)\
**Post date:** [June 30, 2022, 10:01am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/17 "2022-06-30T10:01:14Z")

</div>

I was formally using a Listviewer to preview conversations (Real-time DB) and a real-time adlistener "data change

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [September 28, 2022, 10:02am UTC](https://community.thunkable.com/t/firebase-real-time-chat-issues/1940273/18 "2022-09-28T10:02:02Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
