Showing different content to different people from different countries

Viewed 46

I write the solution in this link

     context.getResources().getConfiguration().getLocales().get(0).getDisplayCountry()

but it doesn't get the user's country. it always shows my own country. when as a user, I use VPN from other countries and println the result, the result doesn't change. am I writing the correct code?

besides, I'm using KOTLIN. is the code the same in KOTLIN and JAVA in this case?!

I just want to find out the user's country, so I can show different content to different people. How should I do that?

1 Answers

You're always getting the same country from the list because of .get(0)

Related