> For the complete documentation index, see [llms.txt](https://esp-ru.gitbook.io/gradient-messenger/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://esp-ru.gitbook.io/gradient-messenger/notification-chat.md).

# Notification chat

I'll show you an example of what you need to know for chat notifications to work!

ЭSo here we are in the chat!  Next, here's a list of what you need to know for background notification to work!  I remind you that the project will be published on Sketchub.

Here is a screenshot.

![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FmGrHXPV88RhYt927D12X%2FIMG_20211028_233133_947.jpg?alt=media\&token=7a3d9edd-ed7c-4064-a6b3-bbb9a105f925) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FMMe6af2B0RldIyTAEP4h%2FIMG_20211028_233133_989.jpg?alt=media\&token=9d78bf08-17fd-4920-9dc1-996b580890d4) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FNUmIFI1S08b04F6jSfCN%2FIMG_20211028_233133_633.jpg?alt=media\&token=aa9f701f-271f-4697-b09a-77ad061f1fb9) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FibZhBtCt0reDTrtzKHYr%2FIMG_20211028_233133_955.jpg?alt=media\&token=7aa3d858-56df-4f7a-9706-1a6e4f2d22b7) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FpB9jrgLR8WYjlY1F0VvI%2FIMG_20211028_233133_814.jpg?alt=media\&token=10bffd18-fff8-41be-bcc8-4ec9dfb42868)

And now in the code that you need to pay attention, if you have a different name for the activity or icons, then change.

![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FO7XJx8KxQRpvXpRzZePV%2FIMG_20211028_233134_503.jpg?alt=media\&token=06de4cc3-3b47-4bd9-8d0a-f7f824273a6d)

be sure to set the permission, otherwise it won't work.

![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2F37lhGKFuZnkdyzgy4gfk%2FIMG_20211028_233133_957.jpg?alt=media\&token=1b1973a1-c5c8-4656-a89f-810e5afa5fed) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2Fre3i5xsEAYurIt2Idupk%2FIMG_20211028_233134_310.jpg?alt=media\&token=5b78c999-f231-4c87-94e6-3bafc807a2b3)

we go to the manifest, where we noted and this code is needed.

![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FDv6LH7IUjwNkBglX0HA9%2FIMG_20211028_233120_458.jpg?alt=media\&token=fb3f39c4-6bfe-4ad4-9d7c-f4114ffeb852) ![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FOFkcvvxS61vXg5lHX14I%2FIMG_20211028_233120_553.jpg?alt=media\&token=9f69f56d-308f-4755-87c1-b27322072488)

```
<service 
   android:name=".NotifyService" 
   android:enabled="true"
   android:exported="true" /> 

<receiver
android:name=".RebootService"
android:label="RebootReciever">
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
```

![](https://29780459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4yIOC9aiCGyyQFj8s2lM%2Fuploads%2FkkKIMlX6rqUvLLNm7xxX%2FIMG_20211028_233134_401.jpg?alt=media\&token=bbe47e3e-7a22-41b8-87b1-c8226b849315)

Well, the last screen, where I noted this, is the sending of a notification.

The structure of the base is as follows.\
&#x20;• When sending a notification, the following fields are created:\
&#x20;  ° from - The UID of the sender is passed here\
&#x20;  ° message - The message is sent here\
&#x20;  ° read - Flag 0 or 1 is written here (0 - message not read, 1 - message read)\
&#x20;P.S.  If the flag is 1, then this notification will not be received, since the service will consider it read\
&#x20;  ° title - Notification title\
&#x20;  ° to - The UID of the recipient is transmitted here (by this field, the service will find out who the notification is assigned to)

@ l e k s from 4pda thanks!=)
