0

i've applied this tutorial to work with fcm: https://learn.microsoft.com/en-us/xamarin/android/data-cloud/google-messaging/remote-notifications-with-fcm?tabs=windows . it worked for android version 10 and 9. when i tested it on android 6, it didn't work. the logs don't even work. for example:

 var logTokenButton = FindViewById<Button>(Resource.Id.logTokenButton);
            logTokenButton.Click += delegate { Log.Debug(TAG, "InstanceID token: " + FirebaseInstanceId.Instance.Token);
           
            };

log.debug doesn't give any result. though when i added toast to see if there is a token value, i got one. what might be wrong? thanks in advance.

rana hd
  • 355
  • 3
  • 18
  • I did a test on android emulator (android 6), and when I sent a notification from the [Firebase Console](https://console.firebase.google.com/) , the emulator could receive the notification. – Jessie Zhang -MSFT Aug 27 '21 at 02:40
  • thanks a lot for your reply. really, it worked? and the logs worked? – rana hd Aug 27 '21 at 11:04
  • hello. i am so sorry for troubling you with my questions. i tried the code on another phone (Samsung) with android version 6 and it worked. but i don't know why it didn't work on the other Huawei phones with android 6. do you have any idea what the problem might be. – rana hd Aug 28 '21 at 07:55
  • the samsung android version is actually 6.0.1, i don't know if that makes a difference but i thought that i should be more accurate – rana hd Aug 28 '21 at 08:44
  • Can your Huawei Phone obtain the token? – Jessie Zhang -MSFT Aug 30 '21 at 02:54
  • the logs actually didn't even work with the Huawei phone. i couldn't read the output logs from it. i used a toast to see if there is a token like this: ```Toast.MakeText(this,FirebaseInstanceId.Instance.Token,ToastLength.Long).Show()``` to read the token instead of Log.Debug, it gave a token and i used the later in the firebase console, but it didn't work – rana hd Aug 30 '21 at 08:56
  • You can try to install the app and try again in your Huawei phone. – Jessie Zhang -MSFT Sep 01 '21 at 02:49

0 Answers0