There is some major bugs in the firebae in-app messaging.
I already wrote some bug reports to google, but as always google support is very reticent to acept their system is full of flaws...
I'm writing this information here because sometimes google likes to work better through stackoverflow and to awarn other users DON'T USE IN-APP MESSAGING IN A PRODUCTION APP
Firebase in app messaging is the new google tool to let you send pop-ups to your users while running your app...
The api was made to be codeless, all you need to do is import the api and configure the firebase dashboard (ZERO LINES OF CODING)
https://firebase.google.com/docs/in-app-messaging/get-started https://www.youtube.com/watch?v=5MRKpvKV2pg
but after installing it, around 1% of my sessions started getting errors. EVEN NULLPOINTEREXCEPTION
how can i be doind something wrong in an api which i didn't wrote a single line of code with? (well firebase support still says i'm doing something wrong)
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.inappmessaging.model.MessageType com.google.firebase.inappmessaging.model.InAppMessage.getMessageType()' on a null object reference
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.extractActions(SourceFile:449)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.inflateBinding(SourceFile:317)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.access$400(SourceFile:82)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$2.run(SourceFile:292)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5753)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
and also
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:910)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
at com.google.firebase.inappmessaging.display.internal.FiamWindowManager.show(SourceFile:62)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$5$4.run(SourceFile:422)
at android.app.Activity.runOnUiThread(Activity.java:6050)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$5.onSuccess(SourceFile:418)
at com.squareup.picasso.ImageViewAction.complete(SourceFile:51)
at com.squareup.picasso.Picasso.deliverAction(SourceFile:558)
at com.squareup.picasso.Picasso.complete(SourceFile:510)
at com.squareup.picasso.Picasso$1.handleMessage(SourceFile:117)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
for this last one crashlytics even say:
This crash is usually caused by your app trying to display a dialog using a previously-finished Activity as a context. For example, this can happen if an Activity triggers an AsyncTask that tries to display a dialog when it is finished, but the user navigates back from the Activity before the task is completed.
as far as i know there is absolutelly nothing i can do, since i've no way to catch this exceptions or somehow change the lib behavior. So if you willing to add this tool to your app, beaware it is still very unstable