How can I check if an in-app product is purchased before?

Please refer to the Sample IAP Project. If the user has purchased before, you would check the receipt Sample IAP Project