For some reason the methode TokenReceived never gets called on my Android device. The script looks like this:
public class FCM : MonoBehaviour
{
public TextMeshProUGUI text;
// Start is called before the first frame update
void Start()
{
Firebase.Messaging.FirebaseMessaging.TokenReceived += TokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += MessageReceived;
}
public void MessageReceived(object sender, MessageReceivedEventArgs e)
{
Debug.Log("Message received: " + e.Message);
}
public void TokenReceived(object sender, TokenReceivedEventArgs e)
{
Debug.Log("Token received: "+ e.Token);
text.text = "received a token";
}
}
I made sure that i have the latest Firebase SDK and i am also able to send a push notification to every device(via firebase console). Now i wanna have the methode TokenReceived triggered, so i can safe that token in my database. I also followed all the steps from: https://firebase.google.com/docs/cloud-messaging/unity/client. Is there anything i am missing?