简体   繁体   English

为什么我的 Firebase 应用内消息在生产中不可靠?

[英]Why are my Firebase In-app messages unreliable in production?

In-app messages work well in test mode, but seem to be very unreliable in production.应用内消息在测试模式下运行良好,但在生产中似乎非常不可靠。 I made campaigns with "Modals" as the message layout.我使用“模态”作为消息布局制作了广告系列。 The simplest possible messages, without any pictures.最简单的消息,没有任何图片。 If I set countries as the targets, no messages seem to be shown in the target countries.如果我将国家/地区设置为目标,则目标国家/地区似乎不会显示任何消息。

I have 2 campaigns without any country targets and those messages get shown, but still just sometimes.我有 2 个没有任何国家/地区目标的广告系列,这些信息会显示出来,但有时还是会显示。 The first of these campaigns informs the user they have an opportunity to reach Level 1. The message get shown about 50% of the times it should be shown (once per device).这些活动中的第一个通知用户他们有机会达到 1 级。消息显示大约 50% 的时间应该显示(每台设备一次)。 Sometimes the message get shown so quickly that it just flashes by, so it is impossible to read the text.有时消息显示得太快以至于它只是一闪而过,因此无法阅读文本。 It closes before the user closes it.它在用户关闭它之前关闭。 The second of these campaigns inform the user when they have reached Level 1. It is the same result as described above here.当用户达到第 1 级时,这些活动中的第二个会通知用户。结果与上述此处描述的结果相同。

My calls to logEvent are from methods, which are directly called from the onresume method in the Main activity of the app.我对 logEvent 的调用来自方法,这些方法直接从应用程序 Main 活动中的 onresume 方法调用。 They are called according to certain conditions, not every time onresume is called.它们是根据某些条件调用的,而不是每次调用 onresume。 My calls look for instance like this:我的电话看起来像这样:

FirebaseAnalytics.getInstance(this).logEvent("gyro_access", Bundle.EMPTY); FirebaseAnalytics.getInstance(this).logEvent("gyro_access", Bundle.EMPTY);

What can be done to make the In-app messages work in a reliable way in production?可以做些什么来使应用内消息在生产中以可靠的方式工作?

I got this to work now.我现在开始工作了。 I used this method instead to trigger the messages:我使用这种方法来触发消息:

FirebaseInAppMessaging.getInstance().triggerEvent() FirebaseInAppMessaging.getInstance().triggerEvent()

I also updated Gradle, so the latest version of com.google.firebase:firebase-inappmessaging-display was used.我还更新了 Gradle,所以使用了最新版本的 com.google.firebase:firebase-inappmessaging-display。

So the solution to my problem was either using the triggerEvent-method or updating Gradle.所以我的问题的解决方案是使用 triggerEvent 方法或更新 Gradle。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM