最近,我Firebase In-APP Messaging在我的应用程序中添加了SDK。几天后,我检查了Firebase crashlytics,发现有一些与In-APP消息传递SDK相关的崩溃:
1. Window Global Manager(WindowGlobalManager.java)
这是堆栈跟踪
Caused by java.lang.IllegalArgumentException
View=com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout{b98919d VFE...C.. ......ID 0,0-0,0 #7f0a014c app:id/image_root} not attached to window manager
Fatal Exception:
java.lang.RuntimeException: Unable to pause activity: java.lang.IllegalArgumentException: View=com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout{b98919d VFE...C.. ......ID 0,0-0,0 #7f0a014c app:id/image_root} not attached to window manager
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3420)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3379)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3354)
at android.app.ActivityThread.access$1100(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5472)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Run Code Online (Sandbox Code Playgroud)
2.图片查看操作(ImageViewAction.java)
这是堆栈跟踪
Fatal Exception:
android.view.WindowManager$BadTokenException: Unable to add window -- …Run Code Online (Sandbox Code Playgroud) 在我的中使用implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'时app/build.gradle,出现以下错误:
Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
Go to the documentation to learn how to Fix dependency resolution errors.
Run Code Online (Sandbox Code Playgroud)
我的内在app/build.gradle是:
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-iid:17.1.2'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'android.arch.work:work-runtime:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
也许我正在使用的库之一已经包含对In-App Messaging依赖的支持,然后它变得多余了?谢谢。
我已经实现了Firebase InApp Messaging,并且对此有一些疑问。一旦我们启动应用程序,就会在 logcat 中收到此消息“正在从服务中获取营销活动”。
firebase 一天内从服务中获取活动多少次。(我不是在谈论每台设备的频率)
以上有时间间隔吗?
我已经浏览了 firebase 文档,但没有提到这样的内容。还参考了下面的博客,了解从应用程序到 firebase 控制台的延迟。(但没有提到 InApp 消息传递)
假设:
根据我的发现,我了解到“Firebase InApp 消息传递”是将上下文消息发送给有价值的用户。因此,Firebase不想向用户发送垃圾邮件。(应用程序启动后,一天中可能只获取一次营销活动)
如果有人有同样的想法,请也分享您的发现。
请建议。
谢谢。
android firebase firebase-analytics firebase-in-app-messaging
有没有办法以编程方式获取 Firebase InApp Messaging?
InstanceID.instanceID().instanceID {} // returns fcm token
Messaging.messaging().fcmToken // returns fcm token
Run Code Online (Sandbox Code Playgroud)
我们可以在启用调试模式参数的同时获取应用程序内消息传递,但我想知道是否可以通过编程方式获取它。