Detect if user is in Europe region Xamarin.Forms project

mac121mac121 Member ✭✭✭

Hi All, How to detect whether a user is in Europe region? I used System.Globalization.RegionInfo.CurrentRegion.Name, this was working fine - but when I changed the device language to french - this gave the region name as france, which is inconsistent.. What should I use to retrieve the user's region correctly. Please assist a working solution. I need this for GDPR implementation
Thanks in advance

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @paul_mac said:
    I need this for GDPR implementation

    Just curious - what will your app do differently if the user is inside or outside Europe?

  • mac121mac121 Member ✭✭✭

    Hi @JohnHardman, we have cookie consent popup to show only for Europe users and not for non-EU.

  • JohnHardmanJohnHardman GBUniversity mod

    @paul_mac said:
    Hi @JohnHardman, we have cookie consent popup to show only for Europe users and not for non-EU.

    Don't forget that if there is a no-deal Brexit, that the UK government plans to incorporate GDPR into UK data protection law, so even though the UK would be non-EU, GDPR effectively still applies. For more information, the Information Commissioner's Office provides plenty of info, such as at https://ico.org.uk/for-organisations/data-protection-and-brexit/information-rights-and-brexit-frequently-asked-questions/

    Countries that are non-EU but in the EEA are also covered by GDPR. There are also dependent territories that are covered by GDPR (see https://beasleydirect.com/gdpr-countries/ )

    Realistically, you'll need to maintain a collection of countries that are covered by GDPR if you want to do different things for those that are and those that are not covered. That collection will change over time as well.

  • mac121mac121 Member ✭✭✭
    edited April 2019

    Ah.. informative man...! But, even I maintain a list, but obviously with what will I compare them with to find EU user or not..?

  • JohnHardmanJohnHardman GBUniversity mod
    edited April 2019

    @paul_mac said:
    Ah.. informative man...! But, even I maintain a list, but obviously with what will I compare them with..?

    You could programmatically retrieve the current locale settings for the device and use those in the lookup. You could also monitor for those changing, to pop up the consent message again if the user changes from a country not covered by GDPR into one covered by GDPR. Of course, that does not cover all edge cases. You could attempt to detect when a telecoms provider changes (such as when you drive between countries), but that's fiddly and still not foolproof.

    Alternatively, you could have a setting within your app, whereby the user can specify the country that they are in. Again, not foolproof.

    Or, you could show the cookie consent message regardless of which country the user is in. Personally, that's what I would do. It just means making the wording generic. I figure that most users are used to seeing such messages these days, so it's not the end of the world if somebody is asked a question that the law does not require them to be asked.

    (The issue with handling this sort of thing technically, is that Europe is not a country, nor is the EU, nor is the EEA. It is a political grouping for which there is no suitable API that identifies whether a user is inside it or outside it. GDPR coverage is even less defined - it's a grouping of countries/territories. Therefore, the easiest thing to do, is to just treat all users the same where possible)

Sign In or Register to comment.