To remember in app purchase subscription i recommend you to use Firebase database to store purchase detail of user. so if user that have purchased subscription reinstall app after uninstall, Firebase will check if user have purchased subscription then ads will disable for that user.
You should allow user to register to your app so you can identify every specific user that purchase subscription
to do so you will need to use clock component to store subscription for specific time example 30 days, then after 30 days Firebase will check purchase subscription validity is expired or not.
I recommend you to search topic about "How to remember user subscription purchase for specific time " if you cant find then create new topic (question) about it, i hope someone will help you with this