1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] in_app_purchase ,I get two prices but cannot distinguish whether the user is...

Discussão em 'Mobile' iniciado por Stack, Outubro 30, 2024 às 20:22.

  1. Stack

    Stack Membro Participativo

    When a subscription has a discounted price, I get two prices but cannot distinguish whether the user is eligible to use the discount or not .

    I added an offer to a subscription [​IMG]

    When I use the queryProductDetails method to get List based on its product id, the length of the list obtained is 2, which are the preferential price and the normal price, but I don’t know which one should be displayed to the user. There is no list in ProductDetails Describing whether the user is eligible to use the discount, the actual payment may be different from the displayed price. I want to show the user the actual price he paid. What should I do?

    Set<String> kIds = <String>{productId!};
    final ProductDetailsResponse response =
    await _iap.queryProductDetails(kIds);
    if (response.notFoundIDs.isNotEmpty) {
    if (response.error != null) _handleError(response.error!);
    }
    List<ProductDetails> products = response.productDetails;

    Continue reading...

Compartilhe esta Página