1. Home
  2. Docs
  3. Documentation
  4. Core Modules
  5. In-App Purchases

In-App Purchases

In order to integrate in-app purchases feature, you need to make sure some of the following steps are correctly configured plus some of the conditions related to App-Connect

1. Pre-conditions

  • A paid Apple Developer account
  • Set up your bank account under agreements section of Itunes Connect

Without either of these conditions, you can not create or retrieve information about the products you want.

2. Create In-App Purchase Products

  • Navigate to App Store Connect, click on the Features tab, select In-App Purchases.
  • Click the (+) to the right of In-App Purchases.

  • Choose your type of products you want to create 
  • Remember the productId. This is a unique string identifying a specific product. There is no standard rule regarding naming this productId, as long as it is unique. We encourage you to name the following: BundleId + Type of your product. For example, you can use: com.instaswipey.InstaswipeyAutoRenewable

3. Create a Sandbox User

  • On App Store Connect, tap on My Apps. It will show some more options. Choose Users and Access

  • Notice the left corner, the bottom part: Select Testers

  • Tap on (+) and fill all information along with an email. This email should be the real one and should also not already be associated with an Apple ID account since we need some verification steps later.
  • This email should be the real one and should also not already be associated with an Apple ID account since we need some verification steps later.

4. Project Configuration

  • Tap on + Capability, in Signing & Capability tab, and choose In-App Purchase (as the picture above)
  • Navigate to ATCIAPProduct enum inside ATCSubscription.swift file in Core/IAP/IAPPurchase directory. At this enum, declare your cases corresponding to productIds. Here is an example that we have applied to the Dating App
enum ATCIAPProduct: String {
    case autoRenewableSubscription = "com.instaswipey.InstaswipeyAutoRenewableSubscription"
    case autoRenewableSubscriptionByYear = "com.instaswipey.InstaswipeyAutoRenewableSubscriptionByYear"
    case freeTrialAutoRenewableSubscription = "com.instaswipey.FreeTrial.InstaswipeyAutoRenewableSubscriptionByMonth"
    case freeTrialAutoRenewableSubscriptionByYear = "com.instaswipey.FreeTrial.InstaswipeyAutoRenewableSubscriptionByYear"
    
    var content: String {
        return rawValue
    }
}

5. Some minor notes

  • You can retrieve all IAP products on iOS simulators but we can only buy or restore purchases on real physical devices.
  • Please remember to log-in to AppleID by the sandbox account before testing.