I have enabled Firebase In-App messaging for my android app. When i am testing In-App Messaging it is showing in SplashActivity of the app.
Note: SplashActivity just have runnable to get delay of 3 seconds. LoginActivity have some functions to check wheter shared preferences are not null.
I tried to add in onCreate() this below line of code:
FirebaseInAppMessaging.getInstance().setMessagesSuppressed(true)
And FirebaseInAppMessaging.getInstance().setMessagesSuppressed(false)
in onDestroy()
I want this messsage to show in MainActivity.
Firebase in-app messaging is triggered by analytical events.
if you want show message in MainActivity ->
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
FirebaseAnalytics.getInstance(this).logEvent("main_activity_ready",null)
//or
//FirebaseInAppMessaging.getInstance().triggerEvent("main_activity_ready");
}
}
and select this event in firebase console.