Skip to content

[iOS] Empty serverVerificationData & localVerificationData in PurchaseDetails #169266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
salimhabar opened this issue May 22, 2025 · 2 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@salimhabar
Copy link

salimhabar commented May 22, 2025

On iOS, I'm receiving empty serverVerificationData and localVerificationData when a purchase is completed using the in_app_purchase Flutter plugin.

Image

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 23, 2025
@darshankawar
Copy link
Member

@salimhabar
When you open an issue, please try to use new issue template and fill out requested details so that we have enough info to work with. Just posting screenshot of the issue will not help much. You need to provide complete runnable code sample in properly formatted text and avoid posting screenshots.

For now, in your case, does PurchaseStatus.pending status is received ? and only the said fields are empty ?
If you run below, does it return value for all fields ?

PurchaseID: ${purchase.purchaseID}
          Local Verification: ${purchase.verificationData.localVerificationData}
          Server Verification: ${purchase.verificationData.serverVerificationData}
          Verification Data Source: ${purchase.verificationData.source}
          Transaction Date: ${purchase.transactionDate}
          ProductID: ${purchase.productID}

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2025
@gaabrielricci
Copy link

I have the same problem, I have an active subscription, and when I try to restore the subscriptions, it returns an array with all the subscriptions and renewals I've had, including the new one I just made, but all with empty verificationData parameters.

Future restorePurchase() async {
try {
List restoredPurchases = [];

  StreamSubscription<List<PurchaseDetails>>? subscription;
  subscription = InAppPurchase.instance.purchaseStream.listen(
    (purchases) {
      restoredPurchases.addAll(purchases);
    },
    onError: (error) {
      ToastOverlay().showMessage("${StringsKeys.erroRestaurarCompras.tr()}: $error", type: ToastOverlayTypeEnum.error);
    },
  );

  await InAppPurchase.instance.restorePurchases();

  await Future.delayed(Duration(seconds: 5));
  await subscription.cancel();

  List<PurchaseDetails> validPurchases = restoredPurchases
      .where((purchase) => purchase.status == PurchaseStatus.restored || purchase.status == PurchaseStatus.purchased)
      .toList();

  if (validPurchases.isNotEmpty) {
    validPurchases.sort((a, b) => (b.transactionDate ?? "").compareTo(a.transactionDate ?? ""));
    PurchaseDetails latestPurchase = validPurchases.first;

    if (latestPurchase.pendingCompletePurchase && latestPurchase.status == PurchaseStatus.pending) {
      await InAppPurchase.instance.completePurchase(latestPurchase);
    }

    await InAppBillingUtil().checkPurchase(latestPurchase);
  } else {
    ToastOverlay().showMessage(StringsKeys.nenhumaAssinaturaAtivaParaRestaurar.tr(), type: ToastOverlayTypeEnum.warn);
  }
} catch (e) {
  ToastOverlay().showMessage(e.toString(), type: ToastOverlayTypeEnum.error);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy