Intermediate: Integration of Huawei Ads with Game Services in Flutter (Cross platform)

Shiddalingeshwar M S
4 min readJun 18, 2021

--

In this article, we will be integrating Huawei Ads and Game Services kit in flutter application. You can access to range of development capabilities. You can promote your game quickly and more efficiently to Huawei’s vast users as Huawei Game Services allows users to login game with Huawei IDs. You can also use the service to quickly implement achievements, game events, and game addiction prevention functions and perform in-depth game operations based on user and content localization. Huawei Ads kit helps developer to monetize application.

Introduction

In this article, we will be integrating Huawei Ads and Game Services kit in flutter application. You can access to range of development capabilities. You can promote your game quickly and more efficiently to Huawei’s vast users as Huawei Game Services allows users to login game with Huawei IDs. You can also use the service to quickly implement achievements, game events, and game addiction prevention functions and perform in-depth game operations based on user and content localization. Huawei Ads kit helps developer to monetize application.

Huawei supports following Ads types

  • Banner
  • Interstitial
  • Native
  • Reward
  • Splash
  • Instream

Huawei Game Services Capabilities

  • Game Login
  • Achievements
  • Floating window*
  • Game Addiction prevention*
  • Events
  • Leaderboards
  • Save Games*
  • Player statistics*
  • Access to Basic Game Information*

Note: Restricted to regions (*)

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 API 4.x.x or above (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.

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

https://gist.github.com/a258768ff11d8ae91aee322caeeac9a9

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

Step 5: Create a project in AppGallery Connect, find here.

How do I launch or initialize the Ads SDK?

How do I load Splash Ads?

How do I load Native Ad?

How do I load Interstitial Ad?

How do I load Rewarded Ad?

How do I launch or initialize the game?

Use Huawei ID for login

How do I get Achievements list?

How do I displaying the Achievements List Page of HUAWEI AppAssistant using Intent?

How do I call Floating window?

How do I get All Events?

How do I get All Leaderboard data?

How do I submit the ranking score?

How do I displaying the Leaderboard List Page of HUAWEI AppAssistant using Intent?

https://gist.github.com/7dcfa390f0df02bf83ce8bb4fdeadb55

Result

Tricks and Tips

  • Make sure that you have downloaded latest plugin.
  • Make sure that updated plugin path Ads in yaml.
  • Make sure that plugin unzipped in parent directory of project.
  • Makes sure that agconnect-services.json file added.
  • Make sure dependencies are added in build file.
  • Run flutter pug get after adding dependencies.
  • Generating SHA-256 certificate fingerprint in android studio and configure in ag-connect.
  • Game Services previous article you can check out here

Conclusion

In this article, we have learnt how to integrate capabilities of Huawei Ads with Game Services kit in flutter application. You can promote your game quickly and more efficiently to Huawei’s vast users as Huawei Game Services allows users to login with Huawei IDs and this can be achieved by implementing its capabilities in your application. Developer can easily integrate and monetize the application which helps developer to grow financial long with application. Similar way you can use Huawei Ads with Game Services as per user requirement in your application.

Thank you so much for reading, I hope this article helps you to understand the Huawei Ads with Game Services capabilities in flutter.

Reference

GameServices Kit

Plutter Plugin Game services

Ads Kit

Checkout in forum

--

--

No responses yet