It manages purchases, restores and consumption for consumable, non-consumable and subscription products.
android:
compile "com.badlogicgames.gdxpay:gdx-pay-android-huawei:$gdxPayVersion"
-ignorewarning
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
"R.string.hms*",
"R.string.connect_server_fail_prompt_toast",
"R.string.getting_message_fail_prompt_toast",
"R.string.no_available_network_prompt_toast",
"R.string.third_app_*",
"R.string.upsdk_*",
"R.string.agc*",
"R.layout.hms*",
"R.layout.upsdk_*",
"R.drawable.upsdk*",
"R.color.upsdk*",
"R.dimen.upsdk*",
"R.style.upsdk*"
- https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#1
- https://consumer.huawei.com/ca/support/content/en-us00698213/
- https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#2
- enabling IAP service : https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#3
- configuring products: https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#4
- integrate HMS sdk into your app: https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#5
- As PurchaseManager you have to instantiate the HuaweiPurchaseManager also passing a IAPListener;
- Into your Activity, in
onPurchaseResult(PurchaseIntentResult result)
write the following code:result.getStatus().startResolutionForResult(this, ANY_RESOLUTION_CODE);
- Into your Activity, override the
onActivityResult(int requestCode, int resultCode, Intent data)
to get the intent result (ref: https://developer.huawei.com/consumer/en/codelab/HMSInAppPurchase/index.html#6) - Optional: to consume a consumable product, after received the purchase result into your
onActivityResult
, there is a method into HuaweiPurchaseManager to manage it:consumeProduct(String inAppPurchaseData)
result ->onConsumedResult(ConsumeOwnedPurchaseResult result)