简体   繁体   English

如何在android中自定义firebase应用内消息?

[英]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.

相关问题 添加Firebase In-App Messaging时出现问题 - Issue in adding Firebase In-App Messaging Firebase云消息传递-未收到任何消息(Android) - Firebase Cloud Messaging - Not receiving any messages (Android) 为什么我的 Firebase 应用内消息在生产中不可靠? - Why are my Firebase In-app messages unreliable in production? Android应用内商店:如何恢复购买 - Android in-app shop: How to restore purchases 如何在 Android 应用程序中实现应用内计费? - How to implement In-App Billing in an Android application? 如何在Android上自定义Firebase Auth域 - How to customize Firebase Auth domain on Android 使用XMPP服务器和Google云消息传递(或更新的Firebase云消息传递)进行推送通知的Android应用程序App - Chat App for Android using a XMPP Server and Google Cloud Messaging (or the newer Firebase Cloud Messaging) for Push Notifications 如何在android中创建即时消息应用程序 - how to create instant messaging app in android Android应用内订阅:如何设置测试帐户而无需提供应用内订阅的银行帐户信息? - Android In-App Subscriptions: How to set testing accounts without giving bank accounts information for In-app subscription? 以编程方式禁用android firebase消息传递 - Disable android firebase messaging programmatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM