Search code examples
androidin-app-purchasehuawei-mobile-services

We are unable to get verification from Huawei server for IAP kit


We are implementing the In-app purchase module. While the implementation we have done all the implementation of the mobile end and server end but after purchasing a subscription we are trying to verify that purchase from the Huawei server through our server in which we got the following error:

get token error! the oauth server response={"sub_error":20003,"error_description":"parameter invalid","error":1101}

can you suggest to us what's the wrong part we are implementing or we are missing something?


Solution

  • According the official documentation, error code 1101 means ,the value of client_id in code or refresh_token is different from that of the input parameter. Here client_id means : App ID, which is the unique identifier allocated by AppGallery Connect to an app after the app is created. For details about how to query the app ID, please refer to Viewing App Basic Information.

    enter image description here

    For details about API for Obtaining an App-Level Access Token, please refer to:

    https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/obtain-application-level-at-0000001051066052

    enter image description here

    For details about API to check whether a product has been successfully purchased by verifying the purchase token for the subscription service, please refer to:

    https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-subscription-verify-purchase-token-0000001050706080

    enter image description here