Question

Restore Purchases issue Flutter - iOS

  • 14 March 2024
  • 2 replies
  • 94 views

Badge +2

Hello,

I'm encountering an issue with my Flutter app's in-app purchase (IAP) functionality, particularly with restoring purchases on iOS.

My app offers a non-consumable premium version that provides lifetime access to certain features. However, during the App Store review process, I received a rejection due to the following reason:

Guideline 3.1.1 - Business - Payments - In-App Purchase

"We found that your app includes a feature to restore previously purchased in-app purchase products by entering the user's Apple ID and password. However, in-app purchases cannot be restored in this manner."

While the restoration process works smoothly on Android without any sign-in prompts, on iOS, it triggers a sign-in prompt, leading to the rejection.

it only happened for app store, everything was fine for google play

Here's the relevant code snippet from my app:

static Future<void> restorePurchases(
PersistenceViewModel persistenceViewModel, BuildContext context) async {
try {
CustomerInfo customerInfo = await Purchases.restorePurchases();

// Handle restored purchases
if (customerInfo.allPurchasedProductIdentifiers.contains(premium)) {
// Handle the restored product identifiers
if (kDebugMode) {
print('Premium version restored');
}

// Here I make the user premium if successfully restored
await persistenceViewModel.setPremium(true);

// Show Alert
if (!context.mounted) return;

showDialog(
context: context,
builder: (BuildContext context) {
return const ShowRestoredAlert();
},
);
}
} on PlatformException catch (e) {
if (kDebugMode) {
print('Error restoring purchases: $e');
}
}
}

I'd like to resolve this issue and ensure that the restoration process works seamlessly on both iOS and Android. How can I modify my code to achieve this without triggering the sign-in prompt on iOS?

Any guidance or suggestions would be greatly appreciated.

Thank you in advance!


This post has been closed for comments

2 replies

Userlevel 3
Badge +8

Hi,

A couple questions:

  1. Does your app have an authentication system?
  2. Any chance this is a non-renewing (not non-consumable) product?
     

(context)

Badge +2

Hi,

A couple questions:

  1. Does your app have an authentication system?
  2. Any chance this is a non-renewing (not non-consumable) product?
     

(context)

I don’t have auth system in my app, and no,  this premium version is a non-consumable product ( not subscription , just normal non-consumable )