Open pas-p opened 1 month ago
I have also been facing this issue. It always calls the onAdFailedToLoad callback but when I add a delay it shows fine. I am not sure if adding a delay in showing App Open Ad allowed or would it cause "Modified Ad Behavior" policy violation. By delay I mean:
`override fun onStart(owner: LifecycleOwner) { super.onStart(owner) addDelay() }
private fun addDelay() { CoroutineScope(Dispatchers.Main).launch { delay(100) // Delay for 2 seconds (2000 milliseconds) // Code after delay println("Delay finished.") currentActivity?.let { appOpenAdManager.showAdIfAvailable(it) } }`
The DefaultLifecycleObserver methods in MyApplication are not called at all. I think this can be solved moving the initialization methods (registerActivityLifecycleCallbacks(this), ProcessLifecycleOwner.get().lifecycle.addObserver(this)) from DefaultLifecycleObserver. onCreate(owner: LifecycleOwner) to Application.onCreate().