通知工作正常,我看到的消息,但是當我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。 –