How can a user pay to see no ads anymore?

Hello

I did already google a lot on this question but did not find a solution. So how can a user make a “buyout” from seeing ads. Do I have to publish two versions of the game? Is there an one-game solution?

Thanks for helping.

General idea:
-Create an in-app purchase to remove ads
-In your code check if person paid to remove ads, if so don’t play ads for that user

I am not experienced with the advertisement class, so sorry I have following question. Will this information be saved in a online userFile, so if the user reinstalls the app, or buying a new handy still stored somewhere in his user information?

Otherwise when I would save it in the playerPrefs it would be gone after a complete reinstall, right?

Thank you.

Information about players’ purchases should be stored somewhere on the server. That information should be loaded, when app is started by player. Rest should be simple bool switch.