-2

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

Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
  • User is trying to reach Firebase support by using SO – cutiko Mar 12 '19 at 03:05
  • 1
    @cutiko, user already reached firebase support, user is trying to make other users aware of the problem since many poeple think that google's apis are flawless... PS. many times firebase support do answer on stackoverflow, this page is even listed in firebase contact page – Rafael Lima Mar 12 '19 at 03:23
  • 2
    While I understand your frustration, Stack Overflow isn't a place to send bug reports. If you haven't written a line of code, there is not much that site designed around asking programming questions can do for you. If your intent is simply to warn others about your experiences, a blog post will do nicely. – Doug Stevenson Mar 12 '19 at 03:41
  • 1
    You can put up an issue in the Firebase Github repo https://github.com/firebase . Have you tried implementing the In-App Messaging separately in a new empty project? Try that first and follow this as example https://github.com/firebase/firebase-android-sdk/tree/master/firebase-inappmessaging-display – MD Naseem Ashraf Mar 12 '19 at 05:12
  • @DougStevenson, disagree with you... SO main goal is to "answer programming questions" but is importance in dev world has many side effects... Googles co. think as theirself as flawless, I had many experiencies in the past of struggling 2 months to prove them that some error was their mistake... then you post on SO, many others devs acknowledge the same problem and google finally go down their shoes and accept their error and fix it. At end SO made its goal that is use community to solve dev problems – Rafael Lima Mar 12 '19 at 16:27
  • it is even listed on https://firebase.google.com/support/ as official support channel... So i'm sorry for the "pure dev question" guys who wants to close my report, it still is the place for such kind of thing – Rafael Lima Mar 12 '19 at 16:29
  • I would encourage you to edit the question and give exact reproduction steps so that anyone can see and understand what's going wrong here. RIght now you're just saying "it doesn't work" without saying exactly what you've done. @MDNaseemAshraf has good advice in suggesting that you start from a fresh project. That's something anyone can do to verify there's a problem. Without the ability to reproduce a problem, you'll not likely get a response. – Doug Stevenson Mar 12 '19 at 17:05
  • @DougStevenson, im going to tell you the same i wrote up there and the same i told the support guy, I CAN'T REPRODUCE IT ON TEST... My app is in production with over 20k installs in real devices with different specs and different usage behaviors this error happens around 0.5% of sessions, It's kind impossible for me generate this kind of test scenario... if google with all the money and "quality devs" was unnable to detect it, why should i be? – Rafael Lima Mar 12 '19 at 17:54
  • It is a null pointer exception any idiot with basic programming skills and access to the source code should be able to identify how and when it will trig i gave them the line number. Again, do you want to reproduce? add ` implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.5'` to you gradle and let it run in over 20k devices... – Rafael Lima Mar 12 '19 at 18:01
  • Please edit the question to show the entire build.gradle. The [setup instructions](https://firebase.google.com/docs/in-app-messaging/get-started) suggest that you should add two dependencies. – Doug Stevenson Mar 12 '19 at 18:20
  • Also it would be crucial to know if you made any configurations in the console, and what *exactly* those are. This is all part of the reproduction steps. – Doug Stevenson Mar 12 '19 at 18:34

3 Answers3

3

I was one of the engineers on FIAM for the initial SDK release. There are definitely still some bugs in the product and the WindowManager crash you linked looks like this known issue: https://github.com/firebase/firebase-android-sdk/issues/112

The NullPointerException doesn't seem like a currently known issue, I'd suggest filing a bug on GitHub to help debugging that.

Sam Stern
  • 24,624
  • 13
  • 93
  • 124
0

Update com.google.firebase:firebase-inappmessaging-display: to latest version

Ashraf Amin
  • 343
  • 3
  • 7
0

Based on a reported issue on Firebase's github (https://github.com/firebase/firebase-android-sdk/issues/4214), a fix for this has been merged on Feb 21, 2023. If you're using Firebase BOM, then in theory, the issue should be resolved in version 31.2.3 onwards. If you're not using BOM, then try to update com.google.firebase:firebase-inappmessaging-display to version 20.3.1.

Jean-Paul Manuel
  • 546
  • 2
  • 12
  • 29