Firebase 云消息传递和 Firebase 应用内消息传递有什么区别?它们都会向您的应用发送发生了某些事情的通知。我查看了他们的文档,这些是他们的单行描述:
Firebase 云消息传递:
Firebase 云消息传递 (FCM) 是一种跨平台消息传递解决方案,可让您可靠地免费发送消息。
Firebase 应用内消息传递:
通过上下文消息吸引活跃的应用程序用户。
他们都向应用程序发送消息。它们之间有什么区别,我什么时候应该使用它们?如果我想向应用程序发送用户已验证其电子邮件的消息,我应该选择哪一个?
所以我正在尝试将新的Firebase应用程序内消息传递功能实现到我的Android应用程序中.但出于任何原因,应用程序崩溃的那一刻我将库添加到我的gradle中.
这是我的傻瓜:
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
Run Code Online (Sandbox Code Playgroud)
我在这里给了poicasso因为在崩溃日志中我得到了与毕加索有关的错误
这是日志文件:
08-19 18:10:08.482 26606-26606/com.kirtu.simpletexts.texts.debug E/CrashlyticsCore: Failed to execute task.
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:177)
at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41)
at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:320)
at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(CrashlyticsController.java:300)
at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:42)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
08-19 18:10:08.484 26606-26606/com.kirtu.simpletexts.texts.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.kirtu.simpletexts.texts.debug, PID: 26606
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/picasso/OkHttpDownloader;
at com.google.firebase.inappmessaging.display.internal.b.b.zzr.get(com.google.firebase:firebase-inappmessaging-display@@17.0.0:2038)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.display.internal.zzf.get(com.google.firebase:firebase-inappmessaging-display@@17.0.0:1021)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.display.zzb.get(com.google.firebase:firebase-inappmessaging-display@@17.0.0:1062)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.display.internal.b.a.zzb.zza(com.google.firebase:firebase-inappmessaging-display@@17.0.0:104)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayRegistrar.zza(com.google.firebase:firebase-inappmessaging-display@@17.0.0:1058)
at com.google.firebase.inappmessaging.display.zza.create(com.google.firebase:firebase-inappmessaging-display@@17.0.0)
at com.google.firebase.components.zzh.zza(com.google.firebase:firebase-common@@16.0.1:29)
at com.google.firebase.components.zzi.get(com.google.firebase:firebase-common@@16.0.1)
at com.google.firebase.components.zzh.get(com.google.firebase:firebase-common@@16.0.1:40)
at com.google.firebase.components.ComponentContainer$$CC.get(com.google.firebase:firebase-common@@16.0.1:15)
at com.google.firebase.components.zzd.get(com.google.firebase:firebase-common@@16.0.1)
at com.google.firebase.components.zzd.zza(com.google.firebase:firebase-common@@16.0.1:68)
at com.google.firebase.FirebaseApp.zze(com.google.firebase:firebase-common@@16.0.1:716)
at …Run Code Online (Sandbox Code Playgroud) 我已为我的 android 应用启用 Firebase 应用内消息传递。当我测试应用内消息时,它显示在应用的 SplashActivity 中。
注意:SplashActivity 刚刚可以运行以获得 3 秒的延迟。LoginActivity 有一些函数来检查共享首选项是否为空。
我试图在 onCreate() 下面的代码行中添加:
FirebaseInAppMessaging.getInstance().setMessagesSuppressed(true)
而FirebaseInAppMessaging.getInstance().setMessagesSuppressed(false)在的onDestroy()
我希望此消息显示在 MainActivity 中。
我一直在尝试将Firebase应用内消息添加到我们的android项目中.它成功构建但是当我在模拟器/设备中运行应用程序时,它会抛出以下错误.
com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/gowthamraj/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/20.0/89507701249388e1ed5ddcf8c41f4ce1be7831ef/guava-20.0.jar
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:405)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at sun.reflect.GeneratedMethodAccessor1162.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at …Run Code Online (Sandbox Code Playgroud) 我刚刚在Firebase上看到一个名为In-App Messaging的新功能.是否已经有一个想法如何让这与Flutter一起工作?
我有一个项目,我同时使用 FirebaseInAppMessaging 和 Dialogflow,但我很难解决依赖关系。添加 FirebaseInAppMessaging 和 Dialogflow 后,出现以下错误:
Duplicate class com.google.protobuf.AbstractMessageLite found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$InternalOneOfEnum found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AbstractParser found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate …Run Code Online (Sandbox Code Playgroud) android firebase protobuf-java dialogflow-es firebase-in-app-messaging
我正在测试Firebase In-App Messaging功能,添加了依赖项
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0'
Run Code Online (Sandbox Code Playgroud)
但android studio抛出了DexArchiveMergerException.我启用了多dexing,如下面的build.gradle所示.
这是我的build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
dexOptions {
keepRuntimeAnnotatedClasses false
}
defaultConfig {
applicationId "np.com.aawaz.csitentrance"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
versionCode 80
versionName "3.1.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2' …Run Code Online (Sandbox Code Playgroud) android firebase google-cloud-firestore firebase-in-app-messaging
目前,我正在尝试让 Firebase 应用内消息显示在物理设备上。由于某种原因,它只会出现在模拟器设备上。我正在使用 Xcode(Swift 编程语言)并且我的 Firebase pod 是最新的。是否需要添加一些额外的代码来触发应用内消息传递?
它仅适用于某些 iOS 设备吗?
(这不是 Firebase 云消息传递)
我开始使用 firebase 的应用内消息传递功能。
我还没有创建真正的广告系列,但仅在创建广告系列时使用[在设备上测试]。所以这个问题与生产中的活动无关,而是与[在设备上测试]功能有关。
该消息不会显示在物理设备上,而是显示在模拟器上。
我无法继续前进,因为我们的应用程序已经投入生产,我需要在上线真正的活动之前确认结果。
我的环境/条件如下:
[Firebase/InAppMessaging][I-IAM180017] 在获取响应中查看测试消息。将当前实例转变为测试实例。
但是控制台没有这样的日志。
所以有人在真实设备上成功测试了该消息,请分享您的经验。