KSemenenko / GoogleAnalyticsForXamarinForms

Google Analytics Plugin for Xamarin Forms
https://www.nuget.org/packages/ksemenenko.GoogleAnalytics
MIT License
67 stars 22 forks source link

.NETStandard support #28

Open PostImpatica opened 6 years ago

PostImpatica commented 6 years ago

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

KSemenenko commented 6 years ago

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

Nixon-Joseph commented 6 years ago

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

Thanks!

PostImpatica commented 6 years ago

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

Nixon-Joseph commented 6 years ago

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.

KSemenenko commented 6 years ago

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

KSemenenko commented 6 years ago

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

Nixon-Joseph commented 6 years ago

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.

LGFox commented 5 years ago

@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...

KSemenenko commented 5 years ago

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

LGFox commented 5 years ago

@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. )))

bigcoops commented 5 years ago

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

KSemenenko commented 5 years ago

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

LGFox commented 5 years ago

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?

KSemenenko commented 5 years ago

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

LGFox commented 5 years ago

@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?

KSemenenko commented 5 years ago

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

LGFox commented 5 years ago

@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!