microg / microg/GmsCore

Error getting firebase messaging token

Open
#2,842 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

I have an Android App that get the firebase messaging token with this code:


FirebaseMessaging.getInstance().getToken().addOnCompleteListener(
                        task -> {
                            if (task.isSuccessful()) {
                                Toast.makeText(this, "token ok", Toast.LENGTH_SHORT).show();
                                String token = task.getResult();
                                Log.i("token ---->>", token);
                                sendFirebaseToken(token);
                            } else {
                                Toast.makeText(this, "token fail", Toast.LENGTH_SHORT).show();

                                Toast.makeText(this, task.getException().toString(), Toast.LENGTH_SHORT).show();


                            }
                        }
                );

On a Googled android device it woks fine but on a Sony Xperia XA2 with Sailfish + Microg I have the exception:

IOException:SERVICE_NOT_AVAILABLE

On MicroG settings I have Cloud Messaging enabled and Connected. The same for Google device registration.

What could I check anymore?

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FirebaseMessaging.getInstance().getToken() call and the IOException:SERVICE_NOT_AVAILABLE result on the Sony Xperia XA2 running Sailfish with MicroG. Check the reported MicroG Cloud Messaging and device registration settings, then compare behavior with the working Google Android device. Done means identifying why token retrieval fails or documenting the missing configuration or compatibility issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, firebase, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.