1

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

我在本教程中的基礎代碼:

https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-android-push-notification-google-fcm-get-started/

任何想法可能是什麼錯?我該怎麼辦 ?

+0

看起來你在這裏混合了一些東西,FCM,GCM和Notification-Hub。如果你能夠隔離這些技術並看看你是否得到了這個問題,那將會很有幫助。我建議從FCM示例開始(https://github.com/firebase/quickstart-android/tree/master/messaging)。該設置比GCM更容易,您仍然可以使用Azure通知中心。不建議混合使用GCM和FCM,因此我只能在通知中心嘗試FCM。 –

回答

0

如果您完全確定該清單是正確的,那麼您可能會碰到一個Android錯誤Google is working on to fixing now。如果你可以可靠地重現問題,讓他們知道在線程中。

但在此之前,請查看this answer以查看是否有幫助。

此外,如果可以,請嘗試在其他設備或模擬器版本上運行該應用程序。如果您在其他設備上看不到錯誤消息,則可能是您最初遇到了錯誤。如果你仍然看到它們,那麼這很可能是某種通用的問題。嘗試searching for a solution

0

@ wroe12,您在Firebase中使用Azure通知中心的Android sample,您遵循教程中的代碼。請git克隆它,並嘗試通過與您的代碼進行比較來找出問題的關鍵。

希望它有幫助。