示例#1
0
        private async Task SaveTeksAsync(IList <TemporaryExposureKey> temporaryExposureKeys)
        {
            TemporaryExposureKeys teks = new TemporaryExposureKeys(temporaryExposureKeys, DateTime.Now)
            {
                Device = DeviceInfo.Model
            };

            string fileName = $"{teks.Id}.json";
            string json     = teks.ToJsonString();

            Logger.D(json);

            var filePath = Path.Combine(_teksDir, fileName);
            await File.WriteAllTextAsync(filePath, json);
        }
示例#2
0
        private async Task SaveTekHistoryAsync(List <TemporaryExposureKey> temporaryExposureKeys)
        {
            TemporaryExposureKeys teks = new TemporaryExposureKeys(temporaryExposureKeys, DateTime.Now)
            {
                Device = DeviceInfo.Model
            };

            string fileName = $"{teks.Id}.json";
            string json     = teks.ToJsonString();

            Logger.D(json);

            AndroidFile filePath = new AndroidFile(_teksDir, fileName);
            await File.WriteAllTextAsync(filePath.AbsolutePath, json);
        }