{"id":23337327,"url":"https://github.com/griesoft/gdprinfo","last_synced_at":"2025-04-07T13:14:56.356Z","repository":{"id":65624221,"uuid":"212193817","full_name":"griesoft/gdprinfo","owner":"griesoft","description":"A .NET MAUI package for Android and iOS with the main purpose of detecting if the current device is in the EEA, which would make it subject to the GDPR regulation.","archived":false,"fork":false,"pushed_at":"2023-01-31T21:01:17.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T10:46:10.694Z","etag":null,"topics":["dotnet","gdpr","library","maui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/griesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-01T20:31:50.000Z","updated_at":"2023-01-31T20:35:49.000Z","dependencies_parsed_at":"2023-02-16T23:15:24.110Z","dependency_job_id":null,"html_url":"https://github.com/griesoft/gdprinfo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/griesoft%2Fgdprinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/griesoft%2Fgdprinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/griesoft%2Fgdprinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/griesoft%2Fgdprinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/griesoft","download_url":"https://codeload.github.com/griesoft/gdprinfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657266,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","gdpr","library","maui"],"created_at":"2024-12-21T02:16:42.405Z","updated_at":"2025-04-07T13:14:56.340Z","avatar_url":"https://github.com/griesoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GdprInfo\n\nA .NET MAUI package for Android and iOS with the main purpose of detecting if the current device is in the EEA, which would make it subject to the GDPR regulation. \n\n[![Build Status](https://dev.azure.com/griesingersoftware/GDPRInfo%20Plugin/_apis/build/status/GdprInfo%20CI?branchName=master)](https://dev.azure.com/griesingersoftware/GDPRInfo%20Plugin/_build/latest?definitionId=34\u0026branchName=master)\n[![NuGet](https://badgen.net/nuget/v/GdprInfo)](https://www.nuget.org/packages/GdprInfo)\n[![GitHub Release](https://badgen.net/github/release/griesoft/gdprinfo)](https://github.com/griesoft/gdprinfo/releases)\n\n## Installation\n\nInstall via [NuGet](https://www.nuget.org/packages/GdprInfo/) using:\n\n``PM\u003e Install-Package GdprInfo``\n\n## Usage\n\n### Registration\nRegister the service in your `MauiProgram` file.\n\n```csharp\nusing GdprInfo;\n\npublic static class MauiProgram\n{\n    public static MauiApp CreateMauiApp()\n    {\n        var builder = MauiApp.CreateBuilder();\n        builder\n            .UseMauiApp\u003cApp\u003e()\n            // Other services before...\n            .ConfigureGdprInfo()\n            // Other service after...\n            ;\n\n        return builder.Build();\n    }\n}\n```\n\n### Consumption:\n\nInject the service via dependency injection in the constructor of the depending class.\n\n```csharp\nprivate readonly IGdprInfoService _gdprInfoService;\n\npublic MyConstructor(IGdprInfoService gdprInfoService)\n{\n    _gdprInfoService = gdprInfoService;\n}\n```\n\nCheck if device is in European Economic Area (EEA):\n\n```csharp\nbool result = _gdprInfoService.IsDeviceInEeaOrUnknow;\n```\n\nYou can also get the ISO country code of the current device\n```csharp\nstring? isoCode = _gdprInfoService.IsoCountryCode;\n```\nIf the ISO code is not null and is part of the EEA, you can also get additional information about the country like this:\n```csharp\nstring? countryName = _gdprInfoService.CountryName;\nstring? countryNumber = _gdprInfoService.CountryNumber;\nstring? longCountryCode = _gdprInfoService.LongCountryCode;\n```\n\n## How does it work\n\nThe service first tries to get the ISO country code via the device telemetry data i.e. network and SIM provider information. If we can't get it from there we look it up from the device's current local setting. Reasons for why we couldn't receive it from telemetry data could be for example that the device is in Flight Mode or that the device has no SIM card inserted at all.\n\nIn case that we couldn't receive the ISO code (unknown), we always have to assume that the device owner is in the EEA. So if the ISO code is unknown, ``IsDeviceInEeaOrUnknow`` will return ``true``.\n\n## Project State\n\nThe project is kind of archived. I do occasional updates as I require them for personal use, but to be honest, in the mean time there are much better ways of doing what this package was trying to do.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriesoft%2Fgdprinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgriesoft%2Fgdprinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriesoft%2Fgdprinfo/lists"}