mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 06:26:02 +00:00
31 lines
No EOL
884 B
C#
31 lines
No EOL
884 B
C#
using AideDeJeu.Tools;
|
|
using System;
|
|
using System.IO;
|
|
using Foundation;
|
|
using System.Threading.Tasks;
|
|
|
|
[assembly: Xamarin.Forms.Dependency(typeof(AideDeJeu.iOS.Version_iOS))]
|
|
namespace AideDeJeu.iOS
|
|
{
|
|
public class Version_iOS : INativeAPI
|
|
{
|
|
public string GetVersion()
|
|
{
|
|
|
|
return NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")].ToString();
|
|
}
|
|
|
|
public int GetBuild()
|
|
{
|
|
var buildVersion = NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleVersion")].ToString();
|
|
int build = 0;
|
|
var res = int.TryParse(buildVersion, out build);
|
|
return res ? build : 0;
|
|
}
|
|
|
|
public async Task<string> GetDatabasePathAsync(string databaseName)
|
|
{
|
|
return NSBundle.MainBundle.PathForResource(databaseName, "db");
|
|
}
|
|
}
|
|
} |