# Widget and In-App Messages

### Pop-up and In-App Message Presentation Behavior <a href="#pop-up-and-in-app-message-presentation-behavior" id="pop-up-and-in-app-message-presentation-behavior"></a>

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.**

### 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**.

<figure><img src="https://2578508252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0bOAscrXzPSujyzq8DEz%2Fuploads%2FVdPChP0UZA3EHg7a443v%2Funnamed%20(6).png?alt=media&#x26;token=f099eb60-e3bc-4845-9f60-07b1a67b4a8a" alt=""><figcaption></figcaption></figure>

### Pop-up Presentation Logic

If a pop-up is received when pop-up presentation is disabled by your code, SDK will store it, and present whenever pop-up presentation is re-enabled. If multiple pop-up notifications are received during that period, SDK stores the most recent notification, and present only that one.

### Enable Pop-up Presentations <a href="#enable-disable-immediate-presentations" id="enable-disable-immediate-presentations"></a>

To enable pop-up presentation, you need to call the `enablePopupPresentation()` method on the page where you want to display the pop-up.

```dart
 Netmera.enablePopupPresentation();
```

{% hint style="info" %}
To show pop-up on the app start or everywhere in the app, please add this to `initState()` method on your `main.dart` file.
{% endhint %}
