Skip to content Skip to sidebar Skip to footer

Firebasecloudmessaging : Firebaseinstanceid Background Sync Failed - Service_not_available

I have use Firebase Cloud Messaging(FCM) API for the push notification in Android. When I implemented that time perfect work but now it's can not find the Service of google play. t

Solution 1:

  1. Verify internet connectivity
  2. Verify if the Android SDK tools(Tools -> Android -> SDK manager -> SDK tools tab) has 'Google Play services' latest version and if not install the package. Then if you are using emulator, please stop the emulator and start it again.It works

Solution 2:

You can check

  1. Check your internet connection with no proxy and open internet connect
  2. Replace your google-service.json with new one you can get this in firebaseconsol
  3. Please check your device has google play service in it and it working or not , firebase not work without google play service

Check -FireBaseInstanceId service does not get registered

Solution 3:

After long struggle i found the answer, if google play service is not running then FirebaseInstanceId background sync failed - SERVICE_NOT_AVAILABLE log print, so you can check your google play service is running properly or not ?

May be this information is helpful to you !

Solution 4:

the service needs to be bound in the Manifest.xml

<!-- Firebase InstanceId Service --><serviceandroid:name="eu.acme.service.FireBaseInstanceIdService"android:exported="false" ><intent-filter><actionandroid:name="com.google.firebase.INSTANCE_ID_EVENT"/></intent-filter></service>

then one can access one single exposed method (the other names are obfuscated = not reliable):

package eu.acme.service;

import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;

publicclassFireBaseInstanceIdServiceextendsFirebaseInstanceIdService {

    @Override@android.support.annotation.WorkerThread
    publicvoidonTokenRefresh() {

        /* obtain the current InstanceId token: */Stringtoken= FirebaseInstanceId.getInstance().getToken();
    }
}

one could only work around it, by not provoking it, eg. by not adding any AuthState Listener while knowing that there is no active network present, as explained here - as it seems, one otherwise cannot catch the exception thrown from within the library - which can be ignored, since it merely just complains, that there is no network connectivity.

com.google.android.gms.iid and com.google.firebase.iid are about the same.

Solution 5:

I had to disbale my VPN - hope this helps someone !

Post a Comment for "Firebasecloudmessaging : Firebaseinstanceid Background Sync Failed - Service_not_available"