gpt4 book ai didi

android - 传递消息 : ServiceIntent not found 时出错

转载 作者:太空宇宙 更新时间:2023-11-03 12:47:24 25 4
gpt4 key购买 nike

我正在尝试在我的 Android 应用程序中将 AWS SNS 推送服务与 FCM 集成。
当我尝试通过 SNS 在线控制台发送推送消息时,我收到此错误日志:

E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/PushListenerService: From: ************ /* My Sender ID*/
E/PushListenerService: Message: hola
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

我在网上搜索了一下,发现一个似乎是一个非常受欢迎的答案,有 3 个类的服务 GcmIntentService, GcmIDListenerService, 注册 Intent 服务。我已经将这些类和服务添加到我的应用程序中,但我仍然没有收到来自 SNS 的任何推送通知。
我也不确定它是否适合我,因为我不仅使用 FCM 服务,还使用 ​​SNS 服务。

这些是我 list 中现有的接收器和服务:

    <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.intap.appme" />
</intent-filter>
</receiver>

<service android:name=".PushListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>

关于推送通知。当我通过 SNS 在线控制台发送它时,我收到上面的日志错误,但是当我通过 Firebase 在线控制台发送它时,设备收到推送通知,但我仍然收到此日志,这是第一个以及上面日志的最后几行:

E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

build.gradle 依赖:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile fileTree(dir: 'libs', include: ['activation.jar'])
compile fileTree(dir: 'libs', include: ['additionnal.jar'])
compile fileTree(dir: 'libs', include: ['mail.jar'])
compile 'com.amazonaws:aws-android-sdk-core:2.2.18'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.18'
compile 'com.amazonaws:aws-android-sdk-ddb:2.2.18'
compile 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.18'
compile 'com.amazonaws:aws-android-sdk-ec2:2.2.18'
compile 'com.google.android.gms:play-services-plus:9.0.1'
compile 'com.amazonaws:aws-android-sdk-sns:2.2.18'
compile 'com.google.android.gms:play-services-gcm:9.0.1'
compile 'com.android.support:multidex:1.0.1'
apply plugin: 'com.google.gms.google-services'
}

你能帮我想清楚并解决吗?

最佳答案

首先,您应该在依赖 block 不在其中之后应用 google-services 插件。此外,我没有看到任何添加 FirebaseInstanceID 的依赖项,因此我不确定为什么会出现该错误。同时使用 FCM 和 GCM 也不是一个好主意,因为同一条消息有多个接收者。使用一个或另一个。这可能就是未收到 sns 消息的原因。

关于android - 传递消息 : ServiceIntent not found 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39962566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com