I follow this tutorial to integrate firebase to my Xamarin project
I face issue in step of adding google-services.json file to .csproj project
after adding this file and restart visual studio , project not responding and keep frizzing
after research I found answer saying file is necessary for Xamarin projects.
so I removed json file and replaced it with my code to initiate firebase
private void ConfigureFireBase()
{
var options = new FirebaseOptions.Builder()
.SetApplicationId(GetString(Resource.String.applicationId))
.SetApiKey(GetString(Resource.String.applicationId))
//.SetDatabaseUrl("Firebase-Database-Url")
.SetGcmSenderId(GetString(Resource.String.applicationId))
.Build();
var firebaseApp = FirebaseApp.InitializeApp(this, options);
Task.Run(() =>
{
var instanceId = FirebaseInstanceId.Instance;
instanceId.DeleteInstanceId();
//Android.Util.Log.Debug("TAG", "{0} {1}", instanceId.Token, instanceId.GetToken(GetString(Resource.String.applicationId), Firebase.Messaging.FirebaseMessaging.InstanceIdScope));
});
}
but till now cant receive token