Once you have created the app vars that are required use the code below to login & verify the version of the app and the version on the site match.
Winforms
private static FusionApp App = new FusionApp("APPID");
private static string currentVersion = "1.0";
private static string liveVersion;
private static string updateurl;
private async void btnLogin_Click(object sender, EventArgs e)
{
var loginResponse = await App.Login(tbUsername.Text, tbPassword.Text, "", false, false);
if (loginResponse.Error == false)
{
try
{
liveVersion = await FusionApp.GetAppVar("version");
updateurl = await FusionApp.GetAppVar("updateurl");
if (!string.Equals(currentVersion, liveVersion))
{
DialogResult dialogResult = MessageBox.Show("There is a new update would you like to download it?", "FusionAPI.dev", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Process.Start(updateurl);
Application.Exit();
}
}
}
catch
{
MessageBox.Show("Failed to get update!", "FusionAPI.dev");
}
Hide();
new Main().Show();
}
else
{
MessageBox.Show(loginResponse.Message, "FusionAPI.dev");
}
}