【发布时间】:2016-10-10 16:19:38
【问题描述】:
我正在尝试在我的 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、RegistrationIntentService。我已将这些类和服务添加到我的应用程序中,但我仍然没有收到来自 SNS 的任何推送通知。
我也不确定这是否适合我,因为我不仅使用 FCM 服务,还使用 SNS 服务。
这些是我清单中现有的接收器和服务:
<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'
}
你能帮我弄清楚并解决它吗?
【问题讨论】:
-
能否将 build.gradle 依赖项添加到问题中?
-
我已将 build.gradle 依赖项添加到问题中
-
你好,你是怎么解决的?
-
如果你在小米上测试,有时候发不了消息,也可以看看这个回答stackoverflow.com/questions/58109753/…
标签: android service firebase-cloud-messaging amazon-sns firebase-notifications