Error Code 4, also known as SKErrorDomain Code=4 - Payment Not Allowed, appears when a device or user account has payment restrictions preventing in-app purchases. This error typically occurs on devices with parental controls or on accounts that lack permissions for purchases. By handling this error effectively, developers can improve user experience and guide users on how to enable payment capabilities.
What Causes SKErrorDomain Code=4?
Error Code 4 is caused by payment restrictions on the user’s Apple ID or device, often enabled through Screen Time parental controls or payment configurations that restrict in-app purchases. Additionally, testing on devices with limited payment capabilities, such as restricted accounts, will produce this error. Developers need to understand these causes to guide users effectively.
Common Scenarios for SKErrorDomain Code=4 - Payment Not Allowed
This error frequently arises in the following situations:
- Parental Controls Enabled: If Screen Time or parental controls are activated, in-app purchases may be restricted.
- Restricted User Accounts: Accounts set up with limitations or those lacking payment permissions can trigger this error.
- Testing on Non-Standard Accounts: Attempting purchases on accounts that don’t allow purchases, such as child accounts or sandbox accounts lacking permissions.
- Device Restrictions on Purchases: Device-level restrictions can prevent purchases, common on devices with certain corporate or family configurations.
Step-by-Step Solutions for SKErrorDomain Code=4
Solution 1: Instruct Users to Check Screen Time and Parental Control Settings
- Purpose: Ensures that parental controls do not prevent in-app purchases.
- Steps:
- Guide users to go to Settings > Screen Time > Content & Privacy Restrictions.
- Under iTunes & App Store Purchases, ensure that In-App Purchases are set to “Allow.”
- Retry the purchase process.
- Result: Users can enable in-app purchase permissions, which eliminates payment restriction issues.
Solution 2: Advise Users to Update Payment Permissions in Apple ID Settings
- Purpose: Ensures the Apple ID used for purchases has the necessary permissions enabled.
- Steps:
- In Settings > [User’s Apple ID] > Media & Purchases > View Account.
- Check that purchase settings are enabled.
- If using Family Sharing, ensure that the main account allows purchases.
- Result: Proper configuration of the Apple ID account resolves errors related to restricted purchases.
Solution 3: Test on a Standard Apple ID Account
- Purpose: Avoids issues related to testing on restricted accounts that don’t permit purchases.
- Steps:
- Log out of restricted or sandbox accounts and log in with a standard Apple ID.
- Ensure the test Apple ID account has enabled in-app purchases.
- Retry the purchase flow with this account.
- Result: Testing on a standard account avoids errors from restricted permissions, allowing for accurate in-app purchase testing.
Solution 4: Enable Payment Method in Apple ID Settings
- Purpose: Ensures the Apple ID has a valid payment method to enable purchases.
- Steps:
- In Settings > [User’s Apple ID] > Payment & Shipping.
- Add or update a valid payment method if none is present.
- Retry the purchase process.
- Result: Adding a valid payment method ensures the account is authorized for purchases, minimizing errors.
Solution 5: Restart Device to Apply Permission Changes
- Purpose: Resets device memory, applying recent settings changes that allow in-app purchases.
- Steps:
- After adjusting permissions or payment settings, restart the device.
- Reopen the app and attempt the purchase again.
- Result: Restarting the device ensures that all permission changes are updated in the system.
Conclusion
Error Code 4 - Payment Not Allowed, often results from device or account restrictions on in-app purchases. By guiding users through Screen Time settings, updating payment permissions, testing on standard accounts, and ensuring valid payment methods, developers can resolve this error effectively.
With Nami’s low-code solutions, you can easily configure in-app purchases without dealing with account restrictions or payment errors. Explore how Nami can simplify your app’s purchase flow at NamiML.