> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSPocketNotificationMessage

> Describes behavior and content for a push notification message.

Describes behavior and content for a push notification message.

## Constructors

### NSPocketNotificationMessage()

```crmscript theme={null}
NSPocketNotificationMessage
```

Initializes a new instance of the NSPocketNotificationMessage class.

## Methods

## GetDate()

```crmscript theme={null}
DateTime GetDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - If the message is about some event happening at a specific date and time.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
DateTime date = thing.GetDate();
```

## GetDuration()

```crmscript theme={null}
TimeSpan GetDuration()
```

**Returns:** [CRMScript.Native.TimeSpan](CRMScript.Native.TimeSpan) - Specify duration of the event.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
TimeSpan duration = thing.GetDuration();
```

## GetExtraValues()

```crmscript theme={null}
Map GetExtraValues()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - Additional key/value properties to include in the message.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Map extraValues = thing.GetExtraValues();
```

## GetMessage()

```crmscript theme={null}
String GetMessage()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The notification message body.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String message = thing.GetMessage();
```

## GetRecordId()

```crmscript theme={null}
Integer GetRecordId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If the message is about some specific database record, this could be its primary key.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer recordId = thing.GetRecordId();
```

## GetSilent()

```crmscript theme={null}
Bool GetSilent()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Indicates wether or not the message will vibrate/play a sound when delivered.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Bool silent = thing.GetSilent();
```

## GetTimeToLive()

```crmscript theme={null}
Integer GetTimeToLive()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Specifies how many minutes the message should be valid.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer timeToLive = thing.GetTimeToLive();
```

## GetTitle()

```crmscript theme={null}
String GetTitle()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Title for the notification.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String title = thing.GetTitle();
```

## GetType()

```crmscript theme={null}
Integer GetType()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The type of notification this is. See \<xref href="CRMScript.NetServer.NotificationMessageType" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer type = thing.GetType();
```

## GetUrl()

```crmscript theme={null}
String GetUrl()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - A URL associated with the notification that will be handled by Pocket.

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String url = thing.GetUrl();
```

## SetDate(DateTime)

```crmscript theme={null}
Void SetDate(DateTime date)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
DateTime date;
thing.SetDate(date);
```

## SetDuration(TimeSpan)

```crmscript theme={null}
Void SetDuration(TimeSpan duration)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
TimeSpan duration;
thing.SetDuration(duration);
```

## SetExtraValues(Map)

```crmscript theme={null}
Void SetExtraValues(Map extraValues)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Map extraValues;
thing.SetExtraValues(extraValues);
```

## SetMessage(String)

```crmscript theme={null}
Void SetMessage(String message)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String message;
thing.SetMessage(message);
```

## SetRecordId(Integer)

```crmscript theme={null}
Void SetRecordId(Integer recordId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer recordId;
thing.SetRecordId(recordId);
```

## SetSilent(Bool)

```crmscript theme={null}
Void SetSilent(Bool silent)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Bool silent;
thing.SetSilent(silent);
```

## SetTimeToLive(Integer)

```crmscript theme={null}
Void SetTimeToLive(Integer timeToLive)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer timeToLive;
thing.SetTimeToLive(timeToLive);
```

## SetTitle(String)

```crmscript theme={null}
Void SetTitle(String title)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String title;
thing.SetTitle(title);
```

## SetType(Integer)

```crmscript theme={null}
Void SetType(Integer type)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
Integer type;
thing.SetType(type);
```

## SetUrl(String)

```crmscript theme={null}
Void SetUrl(String url)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSPocketNotificationMessage thing;
String url;
thing.SetUrl(url);
```


## Related topics

- [SuperOffice.WebApi.Data.PocketNotificationMessage](/en/api/reference/webapi/SuperOffice.WebApi.Data.PocketNotificationMessage.md)
- [NSPocketAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSPocketAgent.md)
- [SuperOffice.WebApi.Agents.PocketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PocketAgent.md)
- [SuperOffice.WebApi.Agents.IPocketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IPocketAgent.md)
- [Send Push Notification](/en/api/reference/restful/agent/pocket_agent/send-push-notification.md)
- [Notification Handled](/en/api/reference/restful/agent/pocket_agent/notification-handled.md)
