Integrating Huawei Remote Configuration and In-App Purchase in Flutter QuizApp (Cross platform)
In this article, we will be integrating Huawei Remote Configuration Service and In-App Purchases in Flutter QuizApp. Here we will fetch the remote data which is questions and answers json data from Ag-console. Huawei provides Remote Configuration service to manage parameters online, with this service you can control or change the behaviour and appearance of you app online without requiring user’s interaction or update to app. By implementing the SDK you can fetch the online parameter values delivered on the AG-console to change the app behaviour and appearance.
Introduction
In this article, we will be integrating Huawei Remote Configuration Service and In-App Purchases in Flutter QuizApp. Here we will fetch the remote data which is questions and answers json data from Ag-console. Huawei provides Remote Configuration service to manage parameters online, with this service you can control or change the behaviour and appearance of you app online without requiring user’s interaction or update to app. By implementing the SDK you can fetch the online parameter values delivered on the AG-console to change the app behaviour and appearance.
Functional features
1. Parameter management: This function enables user to add new parameter, delete, update existing parameter and setting conditional values.
2. Condition management: This function enables user to adding, deleting and modifying conditions and copy and modify existing conditions. Currently, you can set the following conditions version, country/region, audience, user attribute, user percentage, time and language. You can expect more conditions in the future.
3. Version management: This feature function supports user to manage and rollback up to 90 days of 300 historical versions for parameters and conditions.
4. Permission management: This feature function allows account holder, app administrator, R&D personnel, and administrator and operations personals to access Remote Configuration by default.
Huawei In-App Purchases allows you to offer in-app purchases and facilitates in-app payment. Huawei provides easiest way to integrating In-App Purchases in your applications. Users can purchase a variety of virtual products, like Consumable, Non-consumable and Auto-renewable subscription.
Development Overview
You need to install Flutter and Dart plugin in IDE and I assume that you have prior knowledge about the Flutter and Dart.
Hardware Requirements
- A computer (desktop or laptop) running Windows 10.
- A Huawei phone (with the USB cable), which is used for debugging.
Software Requirements
- Java JDK 1.7 or later.
- Android studio software or Visual Studio or Code installed.
- HMS Core (APK) 4.X or later.
Integration process
Step 1. Create flutter project


Step 2. Add the App level gradle dependencies
Choose inside project Android > app > build.gradle
Add root level gradle dependencies
https://gist.github.com/d3d6c1c0b71945fdc573b0ab51f59657
Add app level gradle dependencies
Step 3: Add the below permissions in Android Manifest file.
Step 4: Add below path in pubspec.yaml file under dependencies.

Step 5: Create a project in AppGallery Connect
Step 6: Configuring steps and codelab
How do I check IAP ready for payments?
How do I initiate In-App payment?
Result







Tricks and Tips
- Make sure that the path updated in yampl.
- Makes sure that agconnect-services.json file is added.
- Make sure dependencies are added in gradle.build file.
- Run flutter pug get after adding dependencies.
- Generating SHA-256 certificate fingerprint in android studio and configure in Ag-connect.
- Make sure you added products in ag-console.
- Makes sure you enable the services in ag-console.
- Call isEnvReady method before calling purchase consumable products.
Conclusion
In this article, we have learnt how to integrate Huawei Remote Configuration Service and In-App Purchase in Flutter TechQuizApp questions and answers are fetched from remote configurations in Ag-console and to start the quiz prompts In-app Purchase. You can configure other parameters like app theme, language, style and country etc. to change the app behaviour and appearance and also In-App Purchases.
Thank you so much for reading, I hope this article helps you to understand the Huawei Remote Configuration Service and Huawei In-App Purchase in flutter.
Reference