Netmera Developer Guide
Ask or search…
⌃K
Links

Enable/Disable Widget and In App Messages

All types of push notifications in Netmera work automatically:
All types of push notifications in Netmera work automatically without requiring any additional implementation. In other words, you don't need to code anything to make them function. However, you have the ability to customize the presentation of pop-up notifications and listen to related push callbacks.
When the Netmera SDK receives a popup notification or an in-app message, it immediately displays the corresponding web view content if the application is in the foreground state. If the application is in the background state when a pop-up is received, the SDK presents the web view content when the application comes back to the foreground state.

Enable / Disable Pop-ups

To disable the immediate presentation behavior, such as when users are watching a video, playing a game level, or about to complete an order, you can call the disablePopupPresentation() method on the MainActivity class (not Splash and App classes). Likewise, you can call the enablePopupPresentation() method to re-enable the immediate popup presentation.
// Call this method to disable immediate popup presentation
Netmera.disablePopupPresentation();
​
// Call this method to re-enable immediate popup presentation
Netmera.enablePopupPresentation();
To use in-app messages, you need to integrate the Netmera SDK version 3.4.0 or higher.
  • You can customize the appearance of in-app messages using the attributes defined in the themes.xml file.
<!-- Custom in-app message style -->
<style name="NetmeraInAppMessageStyle">
//in-app message view width in ratio
<item name="inAppMessageWidth">@integer/netmera_default_vertical_width</item>
//in-app message view height in ratio
<item name="inAppMessageHeight">@integer/netmera_default_vertical_height</item>
//in-app message view weight in ratio
<item name="inAppMessageWeight">@integer/netmera_default_vertical_weight</item>
//in-app message view backgroundcolor
<item name="inAppMessageBackground">@drawable/netmera_bg_in_app_message</item>
//in-app message view cancel button image
<item name="inAppMessageCancelButtonDrawable">@drawable/netmera_ic_action_cancel</item>
//in-app message view title size
<item name="inAppMessageTitleSize">@dimen/netmera_text_default_size</item>
//in-app message view title color
<item name="inAppMessageTitleColor">@color/primary_text_light</item>
//in-app message view text size
<item name="inAppMessageTextSize">@dimen/netmera_text_default_size</item>
//in-app message view text color
<item name="inAppMessageTextColor">@color/primary_text_light</item>
//in-app message view title and text fontPath
<item name="inAppMessageFontPath">/assets/fonts/*.ttf</item>
</style>

Storing and Presenting Disabled Popups

If a pop-up notification is received while popup presentation is disabled through your code, the SDK stores it and presents it whenever pop-up presentation is re-enabled. If multiple pop-up notifications are received during that period, the SDK only stores and presents the most recent notification.

Troubleshooting

Widget / In App Issues
If you are experiencing difficulties in receiving popups, please follow these troubleshooting steps:
  1. 1.
    Increase Session Duration:
    • Navigate to the initial panel.
    • Under Developer > App Info find the App Config section.
    • Increase the value in the 'Session Expire Interval' field by 1.
    • Click the 'Apply' button to save the changes.
    • Retry the popup.
  2. 2.
    Check Internet Connection:
    • Verify your device's internet connection to ensure it is stable.
  3. 3.
    Check for Other False Settings:
    • Examine your project to ensure that no other parts of your code are setting values to 'false' that might affect popup functionality.
  4. 4.
    Check for Third-Party Tool Integration:
    • Ensure that Netmera is initialized at the top of your project if any third-party tools are integrated.

Additional Warnings

  1. 1.
    Multiple Concurrent Popups:
    • If multiple popups are set to display simultaneously, it may lead to issues with popup loading.
  2. 2.
    Low Device Storage:
    • Note that if the device's storage is nearly full, popups may not load correctly.
These troubleshooting steps should help you diagnose and resolve any issues related to popup functionality.