I want to integrate Firebase analytic with the Xamarin.Form application so I wanted to know
Firebase analytics support for Xamarin.forms?
How can I integrate with it?
@DavidDupuis unfortunately, I don't remember how I fixed it. But currently I'm using NuGet package Xamarin.Firebase.iOS.Analytics and it works properly. Also maybe try to add in iOS Project Settings -> iOS Build -> Additional mtouch arguments, this value: --registrar:static
Answers
Yes, it does, but you need to handle the logic in each project. So basically:
1. Add Firebase Analytics nuget package to each platform project (you don't need it in the Forms project)
2. Follow the instructions for each platform for initializing Firebase.
iOS AppDelegate - FinishedLaunching
Firebase.Analytics.App.Configure();
Android MainActivity - OnCreate
firebaseAnalytics = FirebaseAnalytics.GetInstance(this);
@RaymondKelly Then how can I manage the click events happen through the xamarin.forms?
You will need to create a dependancy service in each platform. In my case I made a class called Analytics. IOS example:
[assembly: Xamarin.Forms.Dependency(typeof(App.iOS.Analytics))] namespace App.iOS { public class Analytics : IAnalytics {....
I then have a function for each type of event I want to log. E.g.
'public void ConnectToServer(Server server)
{
@RaymondKelly Thanks for your reply hope this will work for me
Hi,
is there any way to use old Google Analytics Api, becasue I don't see this option anymore on web panel - there is only Firebase.
When I add to Xamarin.iOS project the nuget package with Firebase I get those errors:

Hi,
can you tell me because I'm getting this strange error?
Error CS0234: The type or namespace name 'App' does not exist in the namespace 'Firebase.Analytics' (are you missing an assembly reference?) (CS0234)
It refers to:
Firebase.Analytics.App.Configure();
Here you can see Firebase resources on my project:

What do you think is going wrong?
Thank you in advance!
Well... I solved after 3 minutes from last post. I'm sorry!
I don't know why but something changed.
Actually "Firebase.Analytics." doesn't longer contain the "App" class.
It's now in "Firebase.Core"!
I downloaded the sample project from GitHub to try to compile and I saw it.
Taking a look to the documentation I see that (now) it's written:
I'm quite sure it was in Analytics in the past because I was able to compile the code some months ago.
@Tedebus. Your right, "Firebase.Core" working for me.
Thank you!
I tried to install Firebase.Analytic on IOS project and I got the below error. Do anyone experience the same issue? What would be the solution?
Could not install package 'Xamarin.Firebase.Analytics 42.1021.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
KahFaiLok. You are trying to install the android version in iOS. Search for Xamarin iOS firebase Analytics.
App.Configure
method was moved fromFirebase.Analytics
namespace toFirebase.Core
namespace in the mayor release from v3.x to v4.x. Please, importFirebase.Core
to your libraries to use this method.Hi,
I am trying to add Firebase to my Xamarin.Forms project.
I added the Nuget pacjages to iOS and Droid
in my iOS AppDelegate:
Firebase.Core.App.Configure();
then I created a class FirebaseAnalytics.cs:
but I getting this error:
Error CS1519: Invalid token '(' in class, struct, or interface member declaration (CS1519) (ZayedAlKhair.iOS)
for this line:
Firebase.Analytics.Analytics.LogEvent(EventNamesConstants.Login, parameters);
Kindly help..
Thanks
You have to remove the braces from the token manually. In my case I do like this
token.Trim('<').Trim('>').Replace(" ", "");
Hello @WojciechKulik ,
I'm experiencing almost the same problem actually.
Did you find a solution for that?
Hello,
check this answer from stackoverflow: https://stackoverflow.com/a/50764452/9823528
This is how i'm using firebase so far without problems.
Does it work also for UWP somehow?
@DavidDupuis unfortunately, I don't remember how I fixed it. But currently I'm using NuGet package Xamarin.Firebase.iOS.Analytics and it works properly. Also maybe try to add in iOS Project Settings -> iOS Build -> Additional mtouch arguments, this value: --registrar:static
@Wojciech_Kulik, it works! Thanks!
I know this post has been around for a while, but I wanted to first thank you all for the useful answers. I don't mind bumping this since this was the only useful result in google.
To add real value though, I had to track this down for documentation. The change that the Firebase.Analytics to Firebase.Core move has this in git's log