I'm creating a cross-platform app and I am trying to create a service that returns the app's version. I did an interface in the main project and successfully created my service in iOS, however I can't get it to work for Android.
I see code samples elsewhere, but none of them seem to work as shown. They all depend on getting the app's context, yet I have no idea how to do that. For example, this doesn't work:
Context context = this.ApplicationContext;
var version = context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName;
return version;