Skip to main content

Problem

Native in-apps are limited to portrait mode when usingonConfigurationChanged(), which prevents landscape orientation, whereas HTML in-apps support both orientations.

Instructions

  1. Open the Handling Configuration link, change, and override the code in your activity or fragment.
Kotlin
InformationThis method notifies the MoEngage SDK when a configuration change occurs for an activity or fragment that Android does not handle.
  1. To manually manage configuration changes for an activity or fragment, you must add the android:configChanges="orientation" attribute to the relevant <activity> tag within your AndroidManifest.xml file.
AndroidManifest.xml
  1. Run the Native app with this setup, call showInApp() in onResume, and the in-app will appear in its default portrait mode.
3 2
  1. When orientation changes, the in-app disappears and displays ORIENTATION_NOT_SUPPORTED for the native in-app campaign.
4 2
5 1
  1. HTML in-apps support both portrait and landscape orientations. Internally, onConfigurationChanged() calls ConfigurationChangedHandler’s showInAppOnConfigurationChange() of the HTML in-app.
7 1
8
9