I integrated Firebase notifications with Unity 2018.3 and all is working. The app receives notifications while in foreground or background.
I want to allow the user to disable/enable notifications, but I can't find how.
I could ignore the notifications (do nothing in their OnReceive callback), but the user will still get notifications when the game is in the background. I tried removing the callbacks but that didn't work.
if (VNotifications)
{
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
}
else
{
Firebase.Messaging.FirebaseMessaging.TokenReceived -= OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived -= OnMessageReceived;
}