IAP is not working after published in to play store in alpha release

1,003

Now the IAP feature is working in my flutter APP (in Alpha, beta, Production), the problem was in the code. when we try to connect to the store we have this code to check the store availability.

final bool available = await InAppPurchaseConnection.instance.isAvailable();

I was just checking one time and if store available I further coded the premium features logic. But this works always in local, but the published alpha/beta versions never works. so I just changed my code like below.

if(!available)
{
    //try to connect again
    await InAppPurchaseConnection.instance.isAvailable();
}

Here I am just trying to connect the store again, If first time fails. so at first we dont get always the response properly, trying multiple times to connect with store helps to work IAP. I put the logic to check the connection 3 times. Hope this helps!

Share:
1,003
SheikCode
Author by

SheikCode

Updated on December 16, 2022

Comments

  • SheikCode
    SheikCode over 1 year

    I am developing the flutter app which has In-app-Purchases feature, I have created the non-consumable product (one time) in the developer console. And I am using the official flutter package to implement IAP in the app - https://pub.dev/packages/in_app_purchase.

    • IAP product is in active state in the play console
    • I uploaded the right version and version code of the APK
    • My app is in published state
    • I have added the license testers under account settings to test IAP.
    • my androidManifest.xml file updated with right user permission for BILLING.

    when I test the IAP in local it works well, I am able to test the IAP properly. but after I published the same (generated App bundle) in to play store under Alpha release, it does not works. If I check the logs using the abd logcat, then I just getting the below line related to billing

    BillingClient: Client is already in the process of connecting to billing service.

    I am not sure, should I specifically do any app signing before generates the app bundle after added the IAP. I am just using the existing key information which I have used for previous releases to do the app signing.

    Kindly let me know if anybody can help on this problem and I can share if anyother information is required