我正在尝试在我的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'
}
能帮我解决一下并解决它吗?