Intermediate: Huawei Mobile Services Multi kit Part -1 in Flutter (Cross platform)

Shiddalingeshwar M S
4 min readMar 26, 2021

--

In this article, we will be integrating Account kit and Analytics kit in TechQuiz sample application. Flutter Plugin provides simple and convenient way to experience authorization of users. Flutter Account Plugin allows users to connect to the Huawei ecosystem using their Huawei IDs from the different devices such as mobiles phones and tablets, added users can login quickly and conveniently sign in to apps with their Huawei IDs after granting initial access permission.

Introduction

In this article, we will be integrating Account kit and Analytics kit in TechQuiz sample application. Flutter Plugin provides simple and convenient way to experience authorization of users. Flutter Account Plugin allows users to connect to the Huawei ecosystem using their Huawei IDs from the different devices such as mobiles phones and tablets, added users can login quickly and conveniently sign in to apps with their Huawei IDs after granting initial access permission.

Flutter Plugin provides wider range of predefined analytics models to get more insight into your application users, products, and content. With this insight, you can prepare data-driven approach to market your apps and optimize your products based on the analytics.

With Analytics Kit’s on-device data collection SDK, you can:

  • Collect and report custom events.
  • Set a maximum of 25 user attributes.
  • Automate event collection and session calculation.
  • Pre-set event IDs and parameters.

Restrictions

1. Devices:

a. Analytics Kit depends on HMS Core (APK) to automatically collect the following events:

  • INSTALLAPP (app installation)
  • UNINSTALLAPP (app uninstallation)
  • CLEARNOTIFICATION (data deletion)
  • INAPPPURCHASE (in-app purchase)
  • RequestAd (ad request)
  • DisplayAd (ad display)
  • ClickAd (ad tapping)
  • ObtainAdAward (ad award claiming)
  • SIGNIN (sign-in), and SIGNOUT (sign-out).

These events cannot be automatically collected on third-party devices where HMS Core (APK) is not installed (including but not limited to OPPO, vivo, Xiaomi, Samsung, and OnePlus).

b. Analytics Kit does not work on iOS devices.

2. Number of events:

A maximum of 500 events are supported.

3. Number of event parameters:

You can define a maximum of 25 parameters for each event, and a maximum of 100 event parameters for each project.

4. Supported countries/regions

The service is now available only in the countries/regions listed in Supported Countries/Regions.

Integration process

Step 1: Create flutter project

Step 2: Add the App level gradle dependencies. Choose inside project Android > app > build.gradle

Root level gradle dependencies

App level gradle dependencies

Step 3: Add the below permissions in Android Manifest file.

Step 4: Downloaded plugins and unzipped in parent directory of project.

Flutter plugin for Huawei analytics kit.

Flutter plugin for Account kit

Step 5: Add plugin path in pubspec.yaml file under dependencies.

Add path location for asset image

Result

Tricks and Tips

  • Make sure that downloaded plugin is unzipped in parent directory of project.
  • Makes sure that agconnect-services.json file added.
  • Make sure dependencies are added yaml file.
  • Run flutter pug get after adding dependencies.

Conclusion

In this article, we have learnt integration of Huawei Mobile Service (HMS) kits in TachQuizApp i.e login with Account kit using Huawei ID and Analytics Kit into TechQuizApp, which lets you to login and analytics like users, predefined events and Custom events in the Ag-connect.

Thank you so much for reading, I hope this article helps you to understand the Huawei Account kit and Analytics Kit in flutter.

Reference

Account kit

Analytics kit

Flutter Analytics plugin

Flutter Account plugin

--

--

No responses yet