quickstart-android icon indicating copy to clipboard operation
quickstart-android copied to clipboard

FCM can't run well in Android Kitkat and JellyBean (not sure about ICS)

Open dvlwj opened this issue 6 years ago • 8 comments

My environment

  • Android device: Various Device (emulator, some old android device that i borrow from friend i forgot to write down their device name, its come from lenovo)
  • Android OS version: Jelly Beans and Kitkat
  • Google Play Services version: already try to the most updated
  • Firebase/Play Services SDK version: the most updated (4.2.0 for services, 16.0.6 for firebase core, 17.3.4 for firebase messaging)

My problem description:

I trigger a push notification in onMessageReceived, and the problem is the push notification on Android Kitkat and Below. When im trying to debug the phone, an error appear as "E/FirebaseInstanceId: Token retrieval failed: PHONE_REGISTRATION_ERROR". This is not happend in other os and device, they all run without problem.

Steps to reproduce:

  1. I think the description already clear

Observed Results:

  • the onMessageReceived doesn't triggered/run when there is a new message incoming and when i try to debug in Android Studio the E/FirebaseInstanceId: Token retrieval failed: PHONE_REGISTRATION_ERROR appear.

Expected Results:

  • For FCM running in Android kitkat and below

Relevant Code:

Sorry, i doesn't know how to show the code, since its a privacy from my workplace. Maybe if you tell me which part of the code is important then i can try to show it.

dvlwj avatar Dec 04 '18 11:12 dvlwj

oops, sorry i forgot to add the label , thanks for adding it @samtstern

I still can't found the solution, i am waiting for your help and guide @samtstern @kroikie . Thanks.

dvlwj avatar Dec 05 '18 06:12 dvlwj

Hi @dvlwj, FCM is supported from Android 4.0 and later.

To clarify you have added the MESSAGING_EVENT service to your AndroidManifest.xml file?

kroikie avatar Dec 11 '18 14:12 kroikie

@kroikie hi, sorry late respond, working on other project.

yes i already declare and added it in the manifest.

dvlwj avatar Dec 18 '18 08:12 dvlwj

Same problem. If I debug the app with my own device (Android 9), the token is generated correctly. However, If I use an Android Studio virtual machine with Android 4.3, I get the log error message: E/FirebaseInstanceId: Token retrieval failed: PHONE_REGISTRATION_ERROR

gh-jvr avatar Jul 11 '19 11:07 gh-jvr

I also get a lots the same errors predominantly from Asus and Huawei devices.

cosic avatar Sep 13 '19 11:09 cosic

I'm facing the same behaviour for android api < 19. Does anybody found a answer for this issue?

denmusic1992 avatar Oct 29 '19 06:10 denmusic1992

Hi all, @gh-jvr , @cosic , @denmusic1992

Yes, until now I also can't find the solution for this. Last time, my team decided to make a declaration that our App can't support fully for KitKat and JellyBean.

Its will be good if we can got answer/solution from @kroikie now.

dvlwj avatar Oct 29 '19 07:10 dvlwj

hey any body knows the solution? firebase token is getting null in jellybean 4.2.2

vishal14321432 avatar Oct 09 '20 14:10 vishal14321432