ChaseFlorell/FutureFlag

Version Flag

Closed this issue · 0 comments

We need a way to toggle IsEnabled based on the Version.
The trick is getting bundle versions out of iOS and Android cleanly... a quick path to done would be to depend on Xamarin.Essentials however it think it'd be nicer to have no dependencies.

My initial thought is to actually have an init method that just takes two strings or a Version. This would then be invokable from shared code OR the individual platform.

public void Init(string version, string buildNumber)
{
    if(_isInitialized) throw new InitializationException();
    _isInitialized = true;
    _version = new Version(version, buildNumber); // i forget how this constructs, but you get the point.
}

public void Init(Version version)
{
    if(_isInitialized) throw new InitializationException();
    _isInitialized = true;
    _version = version;
}

A second idea (but more work) is to use Conditional builds akin to Xamarin.Essentials and extract the version for each platform that way. I'm still unsure if there is static data I can access in iOS and Android to reduce the need for an Init(this) method.