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:
Netmera.disablePopupPresentation();To re-enable pop-ups, use:
Netmera.enablePopupPresentation();Where to call this method
Call this method only from MainActivity. Do not call it from Splash or the App class.
Configure In-App Presentation Animations
Popup and banner in-app message animations settings are available starting from Android SDK v4.19.0.
You can configure how pop-up and banner in-app messages are presented in netmera-config.json.
If your app does not include this file, create it first. See Configure netmera-config.json.
Supported animation types are:
slide_from_bottomslide_from_topslide_from_rightslide_from_left
To define different animations for pop-ups and banners, add the following configuration to netmera-config.json.
assets/netmera-config.json
In this example, pop-ups are displayed with the slide_from_top animation, while banners are displayed with the slide_from_left animation.
Disable In-App Presentation Animations
If you do not want to use presentation animations, set the animation value to none in netmera-config.json .
No presentation animation is applied by default.
assets/netmera-config.json
In this example, both pop-up and banner in-app messages are displayed without presentation animations.
Customizing Styles Using themes.xml
You can customize the appearance of in-app messages using the attributes defined in the themes.xml file.
Storing Disabled Pop-ups
If pop-ups are disabled, the SDK stores the latest notification and presents it when pop-ups are re-enabled. Older notifications are not stored.
Troubleshooting
If you experience issues with pop-ups or in-app messages, please review the cases below:
Call
enablePopupPresentation()on a Home Screen
Make sure enablePopupPresentation() is called on a screen where the user is expected to stay, such as your app's main or home screen. Do not call it during app initialization or on a splash or intro screen that immediately transitions to another screen.
If this method is called during app initialization or on a screen that immediately transitions to another screen, the pop-up may be triggered in the background, appear beneath the next screen, or fail to display at all.
Increase Session Duration
Go to Developer > App Info > App Config.
Increase Session Expire Interval by 1.
Click Apply and retry.
Review Code for False Values
Make sure no other part of your code disables pop-ups.
Check Third-Party Integrations
Ensure Netmera is initialized at the top of your project.
Check Multiple Pop-Ups
If too many pop-ups trigger at once, they may not load correctly.
Consider Low Device Storage
If storage is nearly full, pop-ups may fail to display.
Last updated
Was this helpful?