MadelineProtoDocs/old_docs/API_docs_v66/constructors/updateServiceNotification.md

48 lines
2.5 KiB
Markdown
Raw Normal View History

2018-04-01 13:19:25 +02:00
---
title: updateServiceNotification
2019-12-27 17:48:04 +01:00
description: A service message for the user.
The app must show the message to the user upon receiving this update. In case the **popup** parameter was passed, the text message must be displayed in a popup alert immediately upon receipt. It is recommended to handle the text as you would an ordinary message in terms of highlighting links, etc. The message must also be stored locally as part of the message history with the user id `777000` (Telegram Notifications).
2018-04-04 19:52:48 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2018-04-01 13:19:25 +02:00
---
2018-04-05 01:19:57 +02:00
# Constructor: updateServiceNotification
2018-04-01 13:19:25 +02:00
[Back to constructors index](index.md)
2019-12-27 17:48:04 +01:00
A service message for the user.
The app must show the message to the user upon receiving this update. In case the **popup** parameter was passed, the text message must be displayed in a popup alert immediately upon receipt. It is recommended to handle the text as you would an ordinary message in terms of highlighting links, etc. The message must also be stored locally as part of the message history with the user id `777000` (Telegram Notifications).
2018-12-26 02:56:50 +01:00
2018-04-01 13:19:25 +02:00
### Attributes:
2018-12-26 02:56:50 +01:00
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
2019-12-27 17:48:04 +01:00
|popup|[Bool](../types/Bool.md) | Optional|(boolTrue) if the message must be displayed in a popup.|
|inbox\_date|[int](../types/int.md) | Optional|When was the notification received<br>The message must also be stored locally as part of the message history with the user id `777000` (Telegram Notifications).|
|type|[string](../types/string.md) | Yes|String, identical in format and contents to the [**type**](https://core.telegram.org/api/errors#error-type) field in API errors. Describes type of service message. It is acceptable to ignore repeated messages of the same **type** within a short period of time (15 minutes).|
|message|[string](../types/string.md) | Yes|Message text|
|media|[MessageMedia](../types/MessageMedia.md) | Optional|Media content (optional)|
2018-12-26 02:56:50 +01:00
|entities|Array of [MessageEntity](../types/MessageEntity.md) | Yes|Entities|
2018-04-01 13:19:25 +02:00
### Type: [Update](../types/Update.md)
### Example:
```php
2018-04-01 13:19:25 +02:00
$updateServiceNotification = ['_' => 'updateServiceNotification', 'popup' => Bool, 'inbox_date' => int, 'type' => 'string', 'message' => 'string', 'media' => MessageMedia, 'entities' => [MessageEntity, MessageEntity]];
```
Or, if you're into Lua:
2018-04-01 13:19:25 +02:00
```lua
2018-04-01 13:19:25 +02:00
updateServiceNotification={_='updateServiceNotification', popup=Bool, inbox_date=int, type='string', message='string', media=MessageMedia, entities={MessageEntity}}
```