To verify whether in-app purchases are activated on your iOS device, follow these steps to access your device's settings:
Go to the "Settings" of your iPhone or iPad.
Go to "Screen Time" > "Content & Privacy Restrictions"
The option "Content & Privacy Restrictions" is likely enabled. If that's the case, go to "iTunes & App Store Purchases" > "In-app Purchases" and select "Allow".
If you are having this problem despite the option Content & Privacy Restrictions being disabled, or for more information regarding this issue, please go through this Apple Guide.