Check for user opt-in to analytics

Hello,


Apologies if this question has already been asked and answered, I searched and couldn't find it.


Is it possibe for me as an app developer to check if a user has opted into analytics? I ask because I would like to add event analytics to one of my apps, but I only want to do so for users who've indicated that they're comfortable sharing analytics data with developers.


Thanks!


-alex