Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-App Messages Flickering and Anchored Incorrectly (Top Instead of Bottom) #818

Open
thushenIpnos opened this issue Oct 16, 2024 · 0 comments

Comments

@thushenIpnos
Copy link

We are experiencing an issue with Iterable's Android SDK where in-app messages, which should be anchored at the bottom of the screen, sometimes appear at the top. The messages flicker between the top and bottom sporadically and can be anchored at the top when they should be at the bottom. This behavior seems tied to whether the home screen is fully loaded.

We previously used a 1-second delay with iterableManager.setAutoDisplayPaused(false) in a custom class called IterableMainActivityObserver to fix the issue, and it worked for a couple of years. However, the issue has returned, and now we have to increase the delay to approximately 20 seconds to stop the flickering and incorrect placement. By increasing the delay to 20 seconds (to account for slower phones), we can assume the home screen will be fully loaded with all its content, which prevents the message from flickering or being misplaced.

Using the Layout Inspector, we observed that the Iterable layout is correctly layered on top of our home screen view. Therefore, we are not sure why Iterable only works without bugging out when the home screen has fully loaded the content on the screen.

Here is the IterableMainActivityObserver class:

class IterableMainActivityObserver : DefaultLifecycleObserver {

    private var job: Job? = null

    private val iterableManager: IterableManager by KoinJavaComponent.inject(IterableManager::class.java)

    override fun onResume(owner: LifecycleOwner) {
        job = owner.lifecycleScope.launch {
            delay(1000L) // Previously worked with 1-second delay, now needs 20 seconds (20000L).
            iterableManager.setAutoDisplayPaused(false)
        }
    }

    override fun onPause(owner: LifecycleOwner) {
        job?.cancel()
        iterableManager.setAutoDisplayPaused(true)
    }
}

Do you have any suggestions on how we can resolve this issue more effectively?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant