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克隆它,并尝试通过与您的代码进行比较来找出问题的关键。

希望它有帮助。