Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase In App Messaging message not displaying

I am integrating Firebase In-App Messaging feature in my application and when I am testing it on my device the message is not being displayed in the application.

I go from SplashActvity to MainActivity and the message is being displayed on both the screens but is dismissed as soon as the onDestroy method of SaplshActivity is called. The SplashActivity uses Handler for going to the MainActivity with 1500 milliseconds of duration. The message is auto-disappearing when onDestroy of SplashActivity is called.

Code for going to MainActivity

new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            Intent intent = new Intent(SplashActivity.this, MainActivity.class);
            startActivity(intent);
            finish();
        }
    }, 1500);

Is there any way to directly open the message in MainActivity?

I've visited the following links for the search of this answer but I am not getting any help.

Link 1

Link 2

Any help will be appreciated. Thanks in advance.

like image 225
Kartik Avatar asked Nov 16 '22 00:11

Kartik


1 Answers

please check if Firebase In-App Messaging API is disabled. Enable it by visiting

https://console.cloud.google.com/apis/library/firebaseinappmessaging.googleapis.com?project=(your project package )

like image 81
devio Avatar answered Jun 24 '23 16:06

devio