Dups Orupsu
Dups Orupsu

Reputation: 21

HMS InAppPurchase - IapClient.isEnvReady() fails with StatusCode 6003

I'm new to HMS and I'm trying to add IAP to an App.

I followed this documentation and I implemented the purchase of a product, but the App fails at the very beginning.

Just after the call to IapClient.isEnvReady(), it answers to the onFailureListener with StatusCode at 6003 (that is not a value present in OrderStatusCode class)

I'm testing it on a device with HMS Core 4.0.3.316 and AppGallery installed.

The App is linking to

com.huawei.hms:iap:4.0.2.300

Can someone give help to me?

What the StatusCode 6003 means and what can I do?

Thanks

Upvotes: 2

Views: 566

Answers (2)

Zinna
Zinna

Reputation: 2035

Per HMS In-App Purchases FAQ, error code 6003 means inconsistent certificate fingerprint configurations, please double-check your configuration based on this doc:

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/faq-0000001050033126-V5#EN-US_TOPIC_0000001050033126__section3517123824210

For complete instructions, please refer to this doc -

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/integrating-sdk-0000001050035023-V5#EN-US_TOPIC_0000001050035023__section1552123620451

(4. Configure the app signature.)

Upvotes: 0

Mahmut Can Sevin
Mahmut Can Sevin

Reputation: 96

To make it work in debug mode, just copy your kestore file to your app dir and add this to your App Level build.gradle:

signingConfigs {
    release {
        storeFile file("YOUR_KEYSTORE_FILE.jks")
        keyAlias 'YOUR_KEY_ALIAS'
        keyPassword 'password1'
        storePassword 'password2'
        v1SigningEnabled true
        v2SigningEnabled true
    }
}


buildTypes {
    release {
        signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    debug {
        signingConfig signingConfigs.release
        debuggable true
    }
}

The 6003 error is caused by inconsistent certificate fingerprint configurations.

Refer to https://developer.huawei.com/consumer/en/codelab/HMSPreparation/#0

Check the following items:

  1. Ensure that the certificate fingerprint has been configured, and the certificate for packing the signature on the local client is the same as the certificate for configuring the fingerprint in AppGallery Connect.

  2. Check the fingerprint entries in the certificate. It is recommended that you use a single entry.

  3. If the 6003 error persists when you run the local client after the fingerprint is configured, the debug certificate is running by default. Clear the cache of HMS Core and run the client again.

Upvotes: 1

Related Questions