[英]how to customize firebase in-app messaging messages in android?
I've tried to customize firebase in-app messaging to change layout of the messages, but I failed it.我曾尝试自定义 firebase 应用内消息传递以更改消息的布局,但失败了。
I followed documents in firebase - https://firebase.google.com/docs/in-app-messaging/customize-messages but couldn't understand what it means.我关注了 firebase 中的文档 - https://firebase.google.com/docs/in-app-messaging/customize-messages但无法理解它的含义。 It's little bit confusing.
这有点令人困惑。
In documentation, it seems quite easy.在文档中,这似乎很容易。 First, write my own FirebaseInAppMessagingDisplay class and register this to headless firebase In-App messaging sdk.
首先,编写我自己的 FirebaseInAppMessagingDisplay 类并将其注册到无头 Firebase 应用内消息传递 sdk。
I tried in 2 ways.我尝试了 2 种方式。
First, import firebase in app messaging display module in android studio project.首先,在android studio项目的app消息显示模块中导入firebase。 But gradle error occured.
但是发生了gradle错误。
next, I tried to make my own in-app messaging display class, but also failed.接下来,我尝试制作自己的应用内消息显示类,但也失败了。
on my knowledge, I need more reference but I can't find it.据我所知,我需要更多参考,但我找不到。
I need some help!我需要帮助!
U Should create your own FirebaseInAppMessageDisplay class by implementing你应该通过实现来创建你自己的 FirebaseInAppMessageDisplay 类
FirebaseInAppMessagingDisplay, Application.ActivityLifecycleCallbacks
like below https://github.com/firebase/firebase-android-sdk/blob/master/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/FirebaseInAppMessagingDisplayImpl.java如下所示https://github.com/firebase/firebase-android-sdk/blob/master/firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/FirebaseInAppMessagingDisplayImpl.java
InAppMessage Object will receive as a parameter in the DisplayMessage callback method InAppMessage 对象将作为参数接收到 DisplayMessage 回调方法中
InAppMessage Object will consist of title, body,imageUrl,campaignId,campaignName InAppMessage 对象将由标题、正文、图片网址、广告系列Id、广告系列名称组成
Using BindingWrapper u can create your own layout使用 BindingWrapper 您可以创建自己的布局
Press Ctrl + N navigate to FirebaseInAppMessaging Display class for more reference (com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay )按 Ctrl + N 导航到 FirebaseInAppMessaging Display 类以获取更多参考 (com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay )
For Reference以供参考
https://firebase.google.com/docs/in-app-messaging/customize-messages?platform=android https://firebase.google.com/docs/in-app-messaging/customize-messages?platform=android
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.