Skip to content

Apple always rejects app because of in app purchase #397

@Turacbey

Description

@Turacbey

Bug Report

Apple says,

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 11.4.1 on Wi-Fi connected to an IPv6 network.

Specifically, we are still unable to purchase IAP in your app. Error dialog appears.

Expected Results
I didn't expect to have a problem when Apple checked in-app purchases.

Actual Results
A problem happened. Error dialog always appears when apple checks the app. errorAlertDialog()

Additional Context

  • Platform: iOS
  • Purchase type: non-consumable
  • Environment: production
  • SwiftyStoreKit Version: 0.13.3

Related Issues

Code

let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "2030202")
SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
    switch result {
     case .success(let receipt):
          let productId = "xxxxxxxxxxxxxxx"
          let purchaseResult = SwiftyStoreKit.verifyPurchase(
               productId: productId,
               inReceipt: receipt)
          switch purchaseResult {
               case .purchased(let receiptItem):
                // Success
                case .notPurchased:
                    SwiftyStoreKit.restorePurchases(atomically: true) { results in
                         if results.restoreFailedPurchases.count > 0 {
                              self.errorAlertDialog()
                        } else if results.restoredPurchases.count > 0 {
                              print("success")
                        } else {
                              print("Nothing to Restore")
                              //purchase      
                              SwiftyStoreKit.purchaseProduct("xxxxxxxxxxxxxxx", quantity: 1, atomically: true) { result in
                              switch result {
                              case .success(let purchase):
                                   SwiftyStoreKit.finishTransaction(purchase.transaction)
                              case .error(let error):
                                   self.errorAlertDialog()
                            }
                        }     
                    }
                }
            }
      case .error(let error):
          self.errorAlertDialog()
       }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    answeredQuestions which have accepted answers.area: receipt-validationvalidating receipts for customer or purchase verificationtype: bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions