[Huawei Developers] Freemind R:
Introduction

Huawei Cab Application is to explore more about HMS Kits in real time scenario, use this app as a reference to CP during HMS integration, and they can understand easily how HMS works in real time scenario, refer previous articles:

Part1 (Login Module with Account Kit and AGC Auth Service)

Part2 (Dashboard Module with Map, Site, Location Kits and TomTom API)

Subscription Module

In-App Purchase Kit: Subscription page allows a Huawei cab user to subscribe the product from the product list and based on subscription products like Silver, Gold and Diamond. User will get benefits like remove the ads on the app, get priority support and also user will get top drivers and cars during cab booking.

Native Ad: Native ads displayed in-between cab booking history list items and removed the ads, once the user subscribes the product.

Analytics Kit: Report the subscription event details to Huawei analytics.

App Messaging: Sending promote offer for the subscribed users through app messaging.

HMS Kits Covered in Subscription Module:

1. Huawei In-App Purchase Kit

2. Huawei Native Ads

3. Huawei Analytics

4. AGC App Messaging

App Screenshots

Subscription

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929094507.28105606272249306190789281771922:50511020033002:2800:4D675D346B97E57FE519AA8CCC6B37BF621E470CC703E688B2F89162A2D8CF45.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929094507.28105606272249306190789281771922:50511020033002:2800:4D675D346B97E57FE519AA8CCC6B37BF621E470CC703E688B2F89162A2D8CF45.png[/IMG]

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929094818.82449061824090976277701419565854:50511020033002:2800:1F770860D2914F6A2BCBCB404B401348E47CD656240A89DA53F9E74DC30B2CFC.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929094818.82449061824090976277701419565854:50511020033002:2800:1F770860D2914F6A2BCBCB404B401348E47CD656240A89DA53F9E74DC30B2CFC.png[/IMG]

App Messaging

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929095058.86040526806244366430821521119050:50511020033002:2800:6C18BB3CFBD85D76C25E6006C0C09B00444FA0B9B68D9CD5F367E421AAFC74C5.jpg"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929095058.86040526806244366430821521119050:50511020033002:2800:6C18BB3CFBD85D76C25E6006C0C09B00444FA0B9B68D9CD5F367E421AAFC74C5.jpg[/IMG]

Native Ads

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929100043.88139323539117064397456761552411:50511020033002:2800:07B9CFA5C7C090ED78502D87DA48E1D8A64860D39C1EB4CCFC5A893EE9BB41BB.jpg"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929100043.88139323539117064397456761552411:50511020033002:2800:07B9CFA5C7C090ED78502D87DA48E1D8A64860D39C1EB4CCFC5A893EE9BB41BB.jpg[/IMG]

Huawei IAP Kit

In-App Purchases aggregates global mainstream payment methods and supports users to buy various types of virtual products and services within an app. IAP provides users with a convenient and high-quality experience and also helps developers to continuously earn revenue and create more business value globally.

Huawei IAP provides a product management system (PMS) for managing the prices and languages of in-app products (including games) in multiple locations.

Sandbox Testing

Sandbox testing allows you to complete end-to-end testing without real payments when you connect to Huawei IAP for joint commissioning. You can configure test accounts in the AppGallery Connect and allow these testers to perform sandbox testing.

Before testing, you need to add test accounts, which are real HUAWEI IDs, under Users and permissions in the AppGallery Connect. For details, refer to Managing Tester Accounts.

Huawei Native Ads

The Native Ad API allows you to build a customized experience for the ads you show in your app. When using the Native Ad API, instead of receiving an ad ready to be displayed, you will receive a group of ad properties such as a media content, ad title, ad source, call to action, and you will have to use them to construct a custom view where the ad is shown.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929100341.44010201799134911114293731640155:50511020033002:2800:F8A94B6CDA40A5F2118C93451669C7FE9F5A997581B4D27726A1B2A6332187C7.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929100341.44010201799134911114293731640155:50511020033002:2800:F8A94B6CDA40A5F2118C93451669C7FE9F5A997581B4D27726A1B2A6332187C7.png[/IMG]

You will also get dislike this ad, rating, etc.

Huawei Analytics Kit

Huawei Analytics Kit is a one-stop data analysis platform for mobile app developers that utilizes data to drive daily app operations, bringing out dynamic details in a comprehensive, timely, and efficient manner. These cutting-edge solutions inspire out-of-the-box app service innovations, helping developers and operations personnel grow revenue and expand the reach of their apps.

Events: An event refers to the behaviour of a user with regard to a product, or in other words, a specific event is something that a user completes at a specific time point, place, and manner.

Real Time Example: Take the process of browsing for a typical item on a cab booking platform, as an example. Corresponding events can include tapping the registration button, accessing the product details app, and exiting the page. Therefore, event monitoring is, in essence, the detailed study of user behaviour within an app.

Huawei In-App Messaging

Huawei In-App Messaging is one of the simplest tools, but it is super useful to keep your active users. The service promotes them to keep using the app by sending messages that enhance or promote certain features of your app.

Note: Merchant Service

1. Choose Console > Developer center > Settings > Merchant Service.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008074727.27340539000613133821649179440754:50511020033002:2800:C0D0678ECF643FCF27F44B853AF365C04247A3E73407B126912B727FE2E35B85.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008074727.27340539000613133821649179440754:50511020033002:2800:C0D0678ECF643FCF27F44B853AF365C04247A3E73407B126912B727FE2E35B85.png[/IMG]

2. You need to activate the IAP service for the first time, Huawei will ask for your bank account information and tax information for the payment.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008075338.50193767132571934420641435044957:50511020033002:2800:9E77FF4108993715A3F66DCDDA1C130AB773A71312C88D926C775209899C4106.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008075338.50193767132571934420641435044957:50511020033002:2800:9E77FF4108993715A3F66DCDDA1C130AB773A71312C88D926C775209899C4106.png[/IMG]

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008075109.32932275324421941032013924543248:50511020033002:2800:CC64FFE61E073282ACA7364A9B5AEC9C72A730C46C2C3DF0F6B2A6F2FC8E8A74.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008075109.32932275324421941032013924543248:50511020033002:2800:CC64FFE61E073282ACA7364A9B5AEC9C72A730C46C2C3DF0F6B2A6F2FC8E8A74.png[/IMG]

3. Finally click submit. Verification of this information will take approximately 1-2 days.

Integration Preparations

You must complete the following preparations to Integrate Huawei IAP, Analytics, Ad Kits and AGC App Messaging.

Create an app in the AppGallery Connect.

Create a project in Android Studio.

Generate a signing certificate.

Generate a signing certificate fingerprint.

Configure the signing certificate fingerprint.

Add the app package name and save the configuration file.

Add the AppGallery Connect plug-in and the Maven repository in the project-level build.gradle file.

Configure the signature file in Android Studio.

Configuring the Development Environment.

Enabling Huawei IAP, Analytics, Ad Kits and App Messaging

1. Sign in to AppGallery Connect, select My apps, click an app, and choose Develop > Overview > Manage APIs.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081100.16379011460308279296691630623599:50511020033002:2800:6C14329412C2EB760127A354E5B1E6CA827B2B053BA7741F27D71CFEE5E84E9C.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081100.16379011460308279296691630623599:50511020033002:2800:6C14329412C2EB760127A354E5B1E6CA827B2B053BA7741F27D71CFEE5E84E9C.png[/IMG]

2. Choose Earning > In-App Purchases. If it is the first time that you use Huawei In-App Purchases (IAP), click Settings.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929101807.36651865463113857911225979598460:50511020074511:2800:3D43091C720D9126146E7AD8E848C7585CFA1096BBEE2D283EEE6E9B44242327.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929101807.36651865463113857911225979598460:50511020074511:2800:3D43091C720D9126146E7AD8E848C7585CFA1096BBEE2D283EEE6E9B44242327.png[/IMG]

3. Once configuration is successful, the page displays the public key used for subsequent payment signature verification and a parameter for configuring the subscription notification URL.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081236.78314829103527950944050825951203:50511020033002:2800:5689945DEE9172A31B0E6DC454A1A1D2AF523112D9883EED53D2D129B9206633.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081236.78314829103527950944050825951203:50511020033002:2800:5689945DEE9172A31B0E6DC454A1A1D2AF523112D9883EED53D2D129B9206633.png[/IMG]

4. Choose Huawei Analytics > Project overview and Enable Analytics Service.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081649.14344207494294154908801546940152:50511020074511:2800:1C2128CE764803734E94824F8C82E2EAC1A1D0149CAC7DD38D35D911B13F69AC.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008081649.14344207494294154908801546940152:50511020074511:2800:1C2128CE764803734E94824F8C82E2EAC1A1D0149CAC7DD38D35D911B13F69AC.png[/IMG]

5. Choose Growing > App Messaging and Enable.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093237.89443450513461892890174427452623:50511020033002:2800:61FB5BF53659EA9FB04CB20E1BA252A436FD589D4A7DA645E06D426F4C018CE2.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093237.89443450513461892890174427452623:50511020033002:2800:61FB5BF53659EA9FB04CB20E1BA252A436FD589D4A7DA645E06D426F4C018CE2.png[/IMG]

Configuration

1. IAP: Configure Product Information. Click the Operate tab. Choose Product Operation > Product Management from the navigation tree on the left, click the Products tab, and click Add Product.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103313.07018620615671328359598305309181:50511020033002:2800:C3E83D21B2AEDB3FFC141CCC43C706F54B51F779169FD779E19A72FBEF0A7BF4.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103313.07018620615671328359598305309181:50511020033002:2800:C3E83D21B2AEDB3FFC141CCC43C706F54B51F779169FD779E19A72FBEF0A7BF4.png[/IMG]

Select Default currency and Default price (tax included) of the product and Save.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103400.59129374057331577899953812414752:50511020033002:2800:C3C917C37F6ACC6DB746E755A5112AAD5DDCE9EB6E5DBD651D9929FAF228A89E.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103400.59129374057331577899953812414752:50511020033002:2800:C3C917C37F6ACC6DB746E755A5112AAD5DDCE9EB6E5DBD651D9929FAF228A89E.png[/IMG]

Activate the product in operation column from the product list.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093007.21321571816258470200955620344507:50511020033002:2800:38A9B6A94E7A0C8847FBB677B2E810DE72503491FC983F96D5F67D669F3D950F.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093007.21321571816258470200955620344507:50511020033002:2800:38A9B6A94E7A0C8847FBB677B2E810DE72503491FC983F96D5F67D669F3D950F.png[/IMG]

2. Creating an App Message. Choose Growing > App Messaging > New.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093115.29153824086705547929559880393789:50511020033002:2800:03E51469D9288BB5528B7F3C6B29E350E53BF1FD7EA8283659D78E75D39E17A6.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20201008093115.29153824086705547929559880393789:50511020033002:2800:03E51469D9288BB5528B7F3C6B29E350E53BF1FD7EA8283659D78E75D39E17A6.png[/IMG]

Enter Name and Description for your in-app message.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103602.07518844810320760031121318689536:50511020033002:2800:AD82BEA929B3B8910FC4657CD0AC903EB29512DCCC99768DD1CE31CE77B65A3C.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103602.07518844810320760031121318689536:50511020033002:2800:AD82BEA929B3B8910FC4657CD0AC903EB29512DCCC99768DD1CE31CE77B65A3C.png[/IMG]

Select Type as Image and Provide Image URL.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103644.47073930089689837833019220419586:50511020033002:2800:A08E91B1C5D382C0B04E9E472984B4A4D61EB37279A00A168B6D7C5AC4B1A0F7.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103644.47073930089689837833019220419586:50511020033002:2800:A08E91B1C5D382C0B04E9E472984B4A4D61EB37279A00A168B6D7C5AC4B1A0F7.png[/IMG]

Select the App package and select sending target. This section is used to set conditions for matching target users.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103723.22784452597894351382065778173555:50511020033002:2800:549FF09ABD84F80196AEEB67960075CE54B11B957200BB3391A20DD401C86C1C.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/631/874/2640091000001631874.20200929103723.22784452597894351382065778173555:50511020033002:2800:549FF09ABD84F80196AEEB67960075CE54B11B957200BB3391A20DD401C86C1C.png[/IMG]

For more information, you can visit https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0202367598227240326&fid=0101187876626530001