Facing FCM token issue in Release mode using Xamarin forms with C#

Raju Gadda 66 Reputation points
2021-08-16T06:20:30.483+00:00

Hello Guys ... I am facing issue a with this module. I have everything in place and it is working when I built the debug apk of the app or when I build it in the android emulator or in a physical device and the token is generating fine ... but when I build a release apk the FCM_ token stops generating. I have tried everything and can't seem to find the issue ... What could be wrong here ?

This is my code to generate the FCM token in MyFirebseIIDService.cs:

    public override void OnTokenRefresh()
    {
        NewToken = FirebaseInstanceId.Instance.Token;
        Xamarin.Forms.Application.Current.Properties["SaveNewToken"] = NewToken;
        Xamarin.Forms.Application.Current.SavePropertiesAsync();
        // SendRegistrationToServer(NewToken);

    }
Developer technologies | .NET | Xamarin
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.