通知工作正常,我看到的消息,但是当我recived通知我有2个错误消息:的Android FCM与Azure的通知集线器错误FirebaseInstanceId
E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
清单
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
tools:replace="android:icon"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<service
android:name=".MyInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<receiver android:name="com.microsoft.windowsazure.notifications.NotificationsBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.xxx.notificationandriodfcm" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
depnds:
compile 'com.google.android.gms:play-services-gcm:9.2.1'
compile 'com.microsoft.azure:notification-hubs-android-sdk:[email protected]'
compile 'com.microsoft.azure:azure-notifications-handler:[email protected]'
repositories {
maven {
url "http://dl.bintray.com/microsoftazuremobile/SDK"
}
}
apply plugin: 'com.google.gms.google-services'
我在本教程中的基础代码:
任何想法可能是什么错?我该怎么办 ?
看起来你在这里混合了一些东西,FCM,GCM和Notification-Hub。如果你能够隔离这些技术并看看你是否得到了这个问题,那将会很有帮助。我建议从FCM示例开始(https://github.com/firebase/quickstart-android/tree/master/messaging)。该设置比GCM更容易,您仍然可以使用Azure通知中心。不建议混合使用GCM和FCM,因此我只能在通知中心尝试FCM。 –