To let your users make purchases right from the in-app messages displayed in your iOS app, you can implement the out-of-the-box solution for your Rich Medias and add callbacks to get more info about in-app purchases.
Rich Media JavaScript implementation
To implement in-app purchases in your Rich Medias, use a simple JavaScript function call:
AppDelegate methods for callbacks
If you need callbacks to be executed on a purchase, implement the PWPurchaseDelegate protocol as follows:
1. Make your project’s AppDelegate conform to the PWPurchaseDelegate protocol:
2. Implement methods of PWPurchaseDelegate in your AppDelegate: