Home
Blog
Handling SKErrorDomain Code=2 on Apple App Store

Handling SKErrorDomain Code=2 on Apple App Store

Portrait photo of blog author
Dan Burcaw
Co-Founder & CEO

Error Code 2, also known as SKErrorDomain Code=2 - Cancelled, is a common error that occurs when users cancel the in-app purchase process. Although this error is user-driven, handling it correctly in your app is essential for a smooth user experience. By managing this cancellation gracefully, developers can improve user satisfaction and even encourage users to reattempt purchases.

Table of Contents:

In this blog post:

What Causes SKErrorDomain Code=2?

Error Code 2 is triggered by user action, specifically when the user backs out or cancels the purchase. This error may result from factors like user hesitation, unclear pricing, or unexpected charges. Though not an app fault, it’s essential to handle this response to prevent potential loss of purchase interest and encourage retrying.

Common Scenarios for SKErrorDomain Code=2 - Cancelled

This error frequently arises in the following scenarios:

  1. User Cancels Due to Unclear Pricing or Additional Fees: Users may abandon the purchase if they see unexpected costs.
  2. Confusing or Unintuitive Purchase Flow: An overly complex purchase flow can frustrate users, leading them to cancel.
  3. Testing Cancellations: During testing, developers or testers may intentionally cancel purchases to test cancellation handling.

Step-by-Step Solutions for SKErrorDomain Code=2 - Cancelled

Solution 1: Implement a Cancellation Handler in StoreKit

  • Purpose: Detects when the purchase flow is cancelled and provides an appropriate user response.
  • Steps:
  1. In your StoreKit implementation, add a cancellation handler to monitor when a transaction returns a cancelled status.
  2. Display a message like, “Purchase cancelled. Would you like to try again?”
  3. Give users an option to retry the purchase process.
  • Result: This helps recover user interest and allows them to reattempt the purchase.

Solution 2: Simplify and Streamline the Purchase Flow

  • Purpose: Reducing complexity in the purchase flow decreases cancellation likelihood.
  • Steps:
  1. Minimize steps in the purchase process to create a clear and smooth flow.
  2. Use simple prompts and provide users with transparent purchase details.
  3. Test the purchase process with a user-focused perspective to remove unnecessary screens or steps.
  • Result: A streamlined flow improves user experience and reduces cancellations.

Solution 3: Display Transparent Pricing Information

  • Purpose: Helps avoid cancellations by showing users clear pricing information, including any potential additional costs.
  • Steps:
  1. Show the total cost upfront in the initial purchase screen, including all applicable taxes or fees.
  2. Add clarifications for recurring subscriptions or auto-renewal features.
  • Result: Transparent pricing reduces user confusion and increases purchase completion rates.

Solution 4: Use Reminders to Encourage Purchase Re-attempts

  • Purpose: Encourages users who have cancelled purchases to revisit the purchase opportunity later.
  • Steps:
  1. For cancelled transactions, consider adding an optional soft reminder for users to complete their purchase later.
  2. Provide additional context or benefits of the purchase to enhance interest.
  • Result: Non-intrusive reminders can help recover lost purchases without disrupting the user experience.

Solution 5: Gather Feedback to Improve the Purchase Experience

  • Purpose: Helps developers understand why users cancel purchases and make adjustments to the purchase flow.
  • Steps:
  1. After a cancellation, offer an optional feedback form asking why they chose to exit.
  2. Analyze feedback to identify common pain points or reasons for cancellation.
  3. Use insights to optimize the purchase process.
  • Result: Understanding cancellation reasons helps refine the purchase experience, ultimately reducing cancellations.

Conclusion

SKErrorDomain Code=2 - Cancelled, is triggered by user actions to exit the purchase process, which may happen due to various reasons. By implementing a cancellation handler, simplifying the purchase flow, displaying clear pricing, sending gentle reminders, and gathering user feedback, developers can improve the purchasing experience and reduce cancellations.

With Nami’s low-code solutions, developers can easily manage and optimize in-app purchases, eliminating the hassle of customizing the purchase flow. Find out more at NamiML.

Dan Burcaw is Co-Founder & CEO of Nami ML. He built a top mobile app development agency responsible for some of the most elite apps on the App Store and then found himself inside the mobile marketing industry after selling his last company to Oracle.

Sign up to our newsletter

Get the latest articles delivered straight to your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Similar articles

Read similar articles to this one