How to disable FirebaseMessagingService

Pedro_MonizPedro_Moniz Member ✭✭
edited February 22 in Xamarin.Android

I am having an annoying issue which I am having a bit of a hard time to understand how to solve it.

In my app there is a login. Certain users should receive notifications when logged in.

At the moment, just as I install the app I get the firebase token on the OnNewToken method ( from the latest nuget as the other method was deprecated ).

Shouldn't I be receiving the token after a call to FirebaseInstanceId.Instance.GetInstanceId(); ?

Also regarding the logout system, tried on logout to call FirebaseInstanceId.Instance.DeleteInstanceId();, but this call just causes a refresh. After I call delete instance I receive a new token.

I do not want the app to have unneeded internet traffic as some users may not even use push notifications.

Any suggestions? I thought about using the topic subscribe system, but it feels like an awkward workaround.

Best Answer

  • Pedro_MonizPedro_Moniz ✭✭
    edited February 22 Accepted Answer

    I fixed my problem by looking in to the firebasemessaging and its auto init feature.

    I had to activate and desactivate it along with the delete instance.

    Firebase instance id and the messaging work together.

Answers

  • Pedro_MonizPedro_Moniz Member ✭✭
    edited February 22 Accepted Answer

    I fixed my problem by looking in to the firebasemessaging and its auto init feature.

    I had to activate and desactivate it along with the delete instance.

    Firebase instance id and the messaging work together.

Sign In or Register to comment.