adaptyteam / AdaptyUI-Flutter

Extension to the Adapty SDK that allows you to easily add purchase screens to your application.
https://docs.adapty.io/docs/paywall-builder-getting-started
MIT License
13 stars 5 forks source link

Bind myProductId to In-app Purchase Product #13

Open burhanrashid52 opened 1 month ago

burhanrashid52 commented 1 month ago

I am using adapty_flutter_ui to show the paywall. I am making a one-time purchase for a product whose ID I want to bind so that if the user comes across the same product, I can identify that the purchase has already been made using myProductId. Since I am using adapty_flutter_ui, I don't have control over how the purchase was made.

Future<bool> buyMyOneTimeProduct(String locale, String myProductId) async {
    await _setMetadataInProfile();
    final paywall = await sdk.getPaywall(placementId: 'Property');
    final view = await ui.createPaywallView(paywall: paywall, locale: locale);
    await view.present();
    // How do I bind success purchase to my myProductId ??
  }

I can listen to the adapty.didProfileUpdate() stream, but then I don't know which purchase is related to myProductId.

x401om commented 1 month ago

Hi @burhanrashid52! Did you pass AdaptyUIObserver to the SDK? You can read more here about events handling.