简体   繁体   English

具有Azure通知中心的Android FCM错误FirebaseInstanceId

[英]Android FCM with Azure Notification Hubs Error FirebaseInstanceId

Notification works fine I see message but when I recived notification I had 2 error message: 通知工作正常我看到消息,但当我收到通知我有2个错误消息:

E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

Manifest 表现

  <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: depnds:

 compile 'com.google.android.gms:play-services-gcm:9.2.1'
    compile 'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'

repositories {
    maven {
        url "http://dl.bintray.com/microsoftazuremobile/SDK"
    }
}


apply plugin: 'com.google.gms.google-services'

I based code on this tutorial: 我基于本教程的代码:

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

Any idea what can be wrong ? 知道什么可能是错的吗? What should I do ? 我该怎么办 ?

If you're completely sure the manifest is correct, it is possible that you're hitting an Android bug that Google is working on to fixing now . 如果您完全确定清单是正确的,那么您可能会遇到Google正在努力修复的Android错误。 If you can reliably reproduce the issue, let them know in the thread. 如果您可以可靠地重现该问题,请在线程中告知它们。

But before you do, take a look at this answer to see if it helps. 但在此之前,请先看看这个答案 ,看看它是否有帮助。

Also, if you can, try to run the app on another device or emulator version. 此外,如果可以,请尝试在其他设备或模拟器版本上运行该应用程序。 If you do not see error messages on another device, then it's possible you were hitting the bug originally. 如果您没有在其他设备上看到错误消息,那么您可能最初遇到了该错误。 If you still see them, then it's most likely some sort of generic issue. 如果你仍然看到它们,那么它很可能是某种通用问题。 Try searching for a solution . 尝试搜索解决方案

@wroe12, There is the Android sample with Azure Notification Hubs in Firebase which you followed the code from the tutorial. @ wroe12,在Firebase中有一个带有Azure通知中心的Android 示例 ,您可以按照教程中的代码进行操作。 Please git clone it and try to check via comparing with your code to find out the key of the issue. 请git克隆它并尝试通过与您的代码进行比较来检查以找出问题的关键。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM