Yes it's possible: you ask the user.
(If you think about it, you've never seen an app (in the last years anyhow, since privacy has become an important topic) installed on your device getting that information without asking you. No reason to assume you could get the info if they weren't able.)