GoogleAnalyticsForXamarinForms icon indicating copy to clipboard operation
GoogleAnalyticsForXamarinForms copied to clipboard

.NETStandard support

Open PostImpatica opened this issue 7 years ago • 17 comments

I can't install this in a .NETStardard library which Xamarin is now suggesting everyone use. Can this be supported?

PostImpatica avatar Jan 02 '18 22:01 PostImpatica

Hi @helzgate, I wold like to move library to .NETStardard. But I need more time.

KSemenenko avatar Jan 02 '18 22:01 KSemenenko

Fully understand this'll take some time, just wondering if there's a timeline or an ETA?

Thanks!

Nixon-Joseph avatar Apr 25 '18 20:04 Nixon-Joseph

@Nixon-Joseph App Center works. I would suggest that and they have a xamarin forms plugin. It's MS version of GA.

PostImpatica avatar Apr 25 '18 22:04 PostImpatica

Ahh okay. Thanks. But if you're not in a rush to update, I think I'll just implement firebase on android and ios and run it as a dependancy service.

Nixon-Joseph avatar Apr 25 '18 22:04 Nixon-Joseph

Hi @Nixon-Joseph for now I don't have enough time to open source, so I will appreciate if you help me.

KSemenenko avatar Apr 26 '18 10:04 KSemenenko

@helzgate Yes, App Center is good tool, but Google analytics is little bit different

KSemenenko avatar Apr 26 '18 11:04 KSemenenko

Sorry totally didn't realize that the message I replied to wasn't you!

I unfortunately don't have a lot of time myself, and the only computer I have at home is Linux only, and I haven't figured out how to run mono yet.

Nixon-Joseph avatar Apr 26 '18 11:04 Nixon-Joseph

@Nixon-Joseph, I'm able to use this nuget package in my NETStandard 1.1 project. You have to add "PackageTargetFallback" statement. See more here. But the problem is that I can't update my project to NETStandard 2.0 because of this. The maximum version which supports PCL libraries is NETStandard1.2...

LGFox avatar Jun 26 '19 17:06 LGFox

Hi @LGFox, if you still use this library I will update this package

KSemenenko avatar Jun 26 '19 19:06 KSemenenko

@KSemenenko, well, ~24 000 of us still using it. I don't have any alternatives for Xamarin.Forms (actually I do but they aren't so popular). )))

But when you will migrate to .NETStandard, it's better to stick to the lowest NETStandard version which you could use. Higher NETStandard version means broader API for you, and worse compatibility for me (because higher versions of NETStandard can use the lower ones, but NOT vice versa). So if you don't need higher NETStandard version - please, don't use it. )))

LGFox avatar Jun 27 '19 09:06 LGFox

I would have also like to have used this, but cannot since .NET Standard 2.0 is not supported.

bigcoops avatar Jun 28 '19 17:06 bigcoops

@bigcoops @LGFox @Nixon-Joseph can you check this version https://www.nuget.org/packages/ksemenenko.GoogleAnalytics/1.0.4-pre

KSemenenko avatar Jul 10 '19 08:07 KSemenenko

Thank you! And you used netstandard1.0 - really cool! I checked it on Android/iOS. There's a breaking change: Plugin.GoogleAnalytics.dll isn't accessible for netstandard1.0. That means I can't use a static class GoogleAnalytics.Current in my netstandard library.

So I created a custom class in my netstandard library with a static Plugin.GoogleAnalytics.Abstractions.IGoogleAnalytics property, and in the native Android/iOS library I assigned GoogleAnalytics.Current to that property. It works for me. In order words, I can use a DI container to create an object of IGoogleAnalytics and use it in my netstandard library.

@KSemenenko , Is this how the nuget package supposed to work in custom netstandard libraries?

LGFox avatar Jul 10 '19 09:07 LGFox

@LGFox maybe you know what version of .net standard is needed to make it more convenient for you to use it?

KSemenenko avatar Jul 10 '19 09:07 KSemenenko

@KSemenenko netstandard1.0, that you used, is the best choice for everyone here. ))) My question is: are you intentionally removed "Plugin.GoogleAnalytics.dll" from the netstandard folder in the nuget package?

LGFox avatar Jul 10 '19 10:07 LGFox

I deleted it so that it does not conflict with the native version. but if it is needed, I will return it. @LGFox

KSemenenko avatar Jul 10 '19 10:07 KSemenenko

@KSemenenko, sorry, I still don't understand the reason (I don't have experience in building nuget packages), but yes, that would be nice to return it!

LGFox avatar Jul 10 '19 10:07 LGFox