# Widget and In-App Messages

### Pop-up and In-App Message Presentation Behavior

All push notifications in Netmera work automatically—no additional coding is required. However, you can **customize** pop-up presentations and **listen to push callbacks**.

By default, when a popup notification or in-app message is received:

* If the app is in the **foreground**, the SDK displays pop-up notifications and in-app messages **immediately**.
* If the app is in the **background**, the SDK shows them **when the app returns to the foreground.**

### Enable / Disable Immediate Presentations

To prevent immediate pop-up presentation (e.g., during video playback, gaming, or checkout), use:

1. **Enable popup and widget push**:

```swift
Netmera.setPopupPresentationEnabled(true)
```

2. **Disable popup and widget push**:

```swift
Netmera.setPopupPresentationEnabled(false)
```

3. **Enable banner push**:

```swift
Netmera.setInAppMessagePresentationEnabled(true)
```

4. **Disable banner push**:

```swift
Netmera.setInAppMessagePresentationEnabled(false)
```

### Receiving Popups and In-App Messages in the Background

To receive popups or in-app messages when the application is in the background, you need to enable **Remote Notifications** under **Background Modes** in **Capabilities**.

### Devices in Low Battery Mode

Devices **cannot** receive popups or in-app messages while the application is closed or killed if the device is in **low battery mode**, as this mode disables background application refresh.
