# Chat app problem

**URL:** https://community.thunkable.com/t/chat-app-problem/1501917
**Category:** Questions about Thunkable X
**Created:** [September 13, 2021, 4:57am UTC](https://community.thunkable.com/t/chat-app-problem/1501917 "2021-09-13T04:57:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 4:57am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/1 "2021-09-13T04:57:55Z")

</div>

Hey there how to make a chat app which saves chat like whatsapp cause I was making a chat app with realtime DB But the Realtime DB Deletes the base after 30days i don’t why but can anyone help with this

[![]( " - YouTube") ](https://www.youtube.com/watch?v=3ZGdZdDMohs)

This is second part after one day by typing same room name

[![]( " - YouTube") ](https://www.youtube.com/watch?v=nZKnU6mGk8Q)

It will only show last chat it will not show whole chats  
I want that when we write same roomname it should show the whole chats while showing only last chat  
[Thunkable](https://x.thunkable.com/projectPage/613da012b8315a0011e74a39) this is link  
please veiw live in Thunkable app in Mobile because the app which i made will not work in PC and LAPTOP

---

<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: [September 13, 2021, 5:14am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/2 "2021-09-13T05:14:54Z")

</div>

When you first create a project in Firebase, it will add a **rule** to the database to prevent access after 30 days. You can go to the `Rules tab` under `Realtime DB` and change the rule.

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:15am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/3 "2021-09-13T05:15:47Z")

</div>

wait sir i am just opening it

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:16am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/4 "2021-09-13T05:16:53Z")

</div>

Sir this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/84179eb7c730aacd25936c515496d6f9efa0041d.png)  
??

---

<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: [September 13, 2021, 5:17am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/5 "2021-09-13T05:17:42Z")

</div>

See this post and see my solution in it. Just do the same.

> [@Do we need to change Firebase rules after 30 days?](https://community.thunkable.com/t/do-we-need-to-change-firebase-rules-after-30-days/1360894):
>
> Do we have to change our firebase project after every 30 days. This is not clearly mentioned in the documentation.

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:21am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/6 "2021-09-13T05:21:39Z")

</div>

sir i saw your post like this i have to do

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/3/13179d3256189a851a8a5b81b5b3ce68f2b21cec.png)  
??  
or like this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/ee6adf73db0e9552ade73e47b4bc75c15512aeb4.png)

---

<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: [September 13, 2021, 5:28am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/7 "2021-09-13T05:28:12Z")

</div>

This is actually up to you.

You can keep the old rule but change the number to the date you want like next year.

You can just write `true` to make it accessible to anyone.

You can make `auth != null` which means users have to login

or `$uid === auth.uid` which means users can only change the data stored under their usernames.

You choose which security rule you want to apply.

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:29am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/8 "2021-09-13T05:29:18Z")

</div>

So sir which is best rule to use for chat app  
Because I am changing the rule first time

---

<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: [September 13, 2021, 5:32am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/9 "2021-09-13T05:32:35Z")

</div>

How are you storing your data?  
Is data stored under the user code retrieved from the `Sign In` component? If this is the case then you can use `$uid === auth.uid`

If you are nor sure then start with `auth != null`.

If you are **not** using the `Sign In` component then you have to use just `true`.

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:34am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/10 "2021-09-13T05:34:50Z")

</div>

Sir i am not using Sign In  
I have only used this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/1/310f985140ae2debe37befec806e2787925b354a.png)  
User and Roomname for chatting and how to use that true  
This is  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c3bc7856f154d1d305717d4f2b917751617ae7b.png)  
This is for That username and roomame  
and for chatting this code  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a5528d58f84613d55f6adeafdf7296ea2dd1c815.png)

---

<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: [September 13, 2021, 5:36am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/11 "2021-09-13T05:36:44Z")

</div>

In this case, you need the `Rules` to look like this

```auto
{
  "rules": {
    ".read": "true", 
    ".write": "true"
  }
}

```

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:37am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/12 "2021-09-13T05:37:43Z")

</div>

Okay sir thank u but just see my prevoius post the [EDIT] one

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:38am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/13 "2021-09-13T05:38:13Z")

</div>

So may i remove dates ?

---

<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: [September 13, 2021, 5:40am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/14 "2021-09-13T05:40:56Z")

</div>

I’m not sure which one you want me to see. Can you `quote it` please?

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:41am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/15 "2021-09-13T05:41:32Z")

</div>

> [@rishabh\_2008](#):
>
> This is
> 
> ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c3bc7856f154d1d305717d4f2b917751617ae7b.png)
> 
> This is for That username and roomame  
> and for chatting this code
> 
> ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a5528d58f84613d55f6adeafdf7296ea2dd1c815.png)

Sir this

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:46am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/16 "2021-09-13T05:46:56Z")

</div>

![Screenshot_20210913-111540](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/e/6e2e0a8693e989229d67bc713bcbc396bfcf051e.png)  
Now also it is not showing the whole chat  
@muneer

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:47am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/17 "2021-09-13T05:47:24Z")

</div>

By doing this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/674d3b8335a2d41dfa655208b7600c8b5c1cd10f.png)  
@muneer

---

<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: [September 13, 2021, 5:55am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/18 "2021-09-13T05:55:04Z")

</div>

The `rule` is correct. Just remove the last comma.

```auto
{
  "rules": {
    ".read": "true",
    ".write": "true"
  }
}

```

---

<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: [September 13, 2021, 5:57am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/19 "2021-09-13T05:57:35Z")

</div>

This could be due to many things, One thing to do is to use the `get block` and show the data retrieved in a label. Do the `get block` on something you know is available in the database and you can see it from the database console.

---

<div class="post-metadata">

### Author: ![rishabh\_2008](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rishabh_2008/32/112230_2.png) [@rishabh\_2008](https://community.thunkable.com/u/rishabh_2008)
#### Post date: [September 13, 2021, 5:59am UTC](https://community.thunkable.com/t/chat-app-problem/1501917/20 "2021-09-13T05:59:37Z")

</div>

Sir can u just see the link and edit the project  
[https://x.thunkable.com/projectPage/613da012b8315a0011e74a39](https://x.thunkable.com/projectPage/613da012b8315a0011e74a39)

[Next page](https://community.thunkable.com/t/chat-app-problem/1501917.md?page=2)
