UNNotification.Badge
--------------------

Queries badge number.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [UNNotification](component_UNNotification.md) | [7.2](newinversion72.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "UNNotification.Badge"; UNNotificationRef ) 

**MBS**( **"UNNotification.Badge";** /\* Queries badge number. \*/  
**$UNNotificationRef**) /\* The reference number of the notification.e.g. $Notification \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| UNNotificationRef | The reference number of the notification. | $Notification |

### Result

Returns number, empty result or error.

### Description

Queries badge number.  
Can be empty to leave badge unchanged.  
Zero means no badge. Else the given number is used for application badge on delivery.  
### Examples

Test badge property:

 # Create a new notification   
Set Variable \[$notification ; Value:MBS ("[UNNotification.New](UNNotificationNew.md)")\]  
\# set a badge   
Set Variable \[$r ; Value:MBS ("[UNNotification.SetBadge](UNNotificationSetBadge.md)"; $notification ; 123)\]  
\# and query back   
Set Variable \[$value ; Value:MBS ("UNNotification.Badge"; $notification )\]  
\# free memory   
Set Variable \[$r ; Value:MBS ("[UNNotification.Release](UNNotificationRelease.md)"; $notification )\]  
### See also

- [UNNotification.AddFile](UNNotificationAddFile.md)
- [UNNotification.AddImage](UNNotificationAddImage.md)
- [UNNotification.Body](UNNotificationBody.md)
- [UNNotification.Date](UNNotificationDate.md)
- [UNNotification.List](UNNotificationList.md)
- [UNNotification.New](UNNotificationNew.md)
- [UNNotification.Release](UNNotificationRelease.md)
- [UNNotification.SetBadge](UNNotificationSetBadge.md)
- [UNNotification.Title](UNNotificationTitle.md)
- [UNNotification.Type](UNNotificationType.md)

This function is free to use.

Created 15th April 2017 , last changed 17th April 2017

  
[UNNotification.AuthorizationGranted](UNNotificationAuthorizationGranted.md) - [UNNotification.Body](UNNotificationBody.md)

[HTML Version](UNNotificationBadge.shtml)