Huawei Ability Gallery — Account Binding w Card Ability

Enes Kocaman
Huawei Developers
Published in
6 min readMay 8, 2021

--

The effect of the Internet on our lives has enabled us to be informed about the events in our world, not every other day, but after a few hours, sometimes minutes, and sometimes seconds. Undoubtedly, in the shortening of this period, our mobile phones that we carry in our pockets and always with us or our “Smart Phones” as they are commonly used now have a big share. As a result of the rapid development of technology today, many phone models have superiority over some laptop / desktop computer models in terms of speed, as well as the ease of use they provide, pushing end users to access the Internet using mobile phones instead of computers.

In the current statistics below, you can find the usage rates of mobile devices when accessing websites around the world between the Q1, 2015 and the Q1, 2021.

https://www.statista.com/statistics/277125/share-of-website-traffic-coming-from-mobile-devices/

2015 Q1 → 31.16%

2021 Q1 → 54.80%

Based on this statistic, when we consider the competition between today’s mobile phone manufacturers; It would not be wrong to predict that the rate of users accessing the Internet via mobile phones will not decrease in the coming years, on the contrary, it will increase even more.

For this reason, a product offered by a company or an individual developer to the end user can be downloaded from mobile application markets, means that it will reach more users.

Is it sufficient to increase the number of users by being only in mobile application markets?

Of course not. While counting the reasons behind why users prefer smartphones over computers to access the internet, we mentioned Speed ​​and Easy Accessibility.

If we want to gather these two concepts under a common roof, we can call it Convenience. Access to the Internet via smart phones is easier than computers, but this alone is not enough when we consider how much convenience technology provides to human life day by day.

A user using a smartphone will look for a more effective way to do the transaction without downloading the application from the market, without even spending time on opening the application.

For users who make this search on Huawei branded smartphones, the solution will be the Huawei Ability Gallery screen.

Users who own Huawei branded smartphones can use the Card Ability and Content Ability offered to users on the Ability Gallery page, known as the “-1 screen” of the phones, to reach the results they request without opening the relevant application. To explain with an example;

Let’s think of an application that provides train ticket reservation service, to follow the details of the ticket you have bought through this application (Train Timetable Number, Timetable, Wagon Number, Seat No, etc.) via a fixed Card created on the Huawei Ability Gallery page without having to open the application again. it would be easy, right?

In order to provide this service, the Huawei user must first match the UID assigned to him by the application when he logs into the application with the Open ID assigned by Ability Gallery. The name of this pairing process is “Account Binding”. In the rest of the article, we will examine the steps of the Account Binding process.

What is Account Binding?

Account Binding is the matching process between two different components or data belonging to a user’s account.

This pairing starts as soon as the user clicks on the “Associate” option in Card Ability. The Open Id created by Huawei Ability Gallery, which allows the user to be associated with the relevant ability, and the account Id (UID) assigned to the user by the developer’s server while logging in to the mobile application is stored in the developer’s database by matching. By sending the result of the pairing to Huawei Ability Gallery Server, the binding process is completed.

Why is it needed?

Using the Event Push feature provided by Huawei Ability Gallery may require Account Binding.

Event Push allows you to offer personalized content to your users on the Card. These; reminder of the passenger boarding pass, the status of the called taxi, etc. These are the contents that contain the target user group and Account Binding process becomes mandatory in order to reach the target user audience.

In which cases is it not necessary apply to Account Binding?

Let’s imagine that there is a Card Ability showing live results from the English Football League. The content offered on this Card does not need to be customized for any user. In similar cases, there is no need to perform the Account Binding process on cards that offer content to the general user audience.

How is it applied? Let’s examine it step by step…

Account Binding in Cards Solution-2 Architecture

We can understand this process better by explaining each step through the architecture you have seen above.

1- The part required in the first stage for Account Binding process is Server Side:
At this stage, the developer must design the end-point in the specified format that will generate the response to be returned in response of the POST request to be sent by Huawei Ability Gallery.

2- In developer account, Ecosystem Services> Smart Services> Huawei Ability Gallery

a. While performing the configurations on the Ability Gallery Console screen, the “Custom sign-in” option should be selected in the Account Linking section and the address of the backend URL designed should be entered in the “Receiving URL” section.

b. Keys of 64 characters in total must be entered into the Access Key and Secret Key fields. (You can produce the keys yourself)

Selecting Custom Sign-in

c. Finally, the transactions made by clicking the Save button should be saved.

3- Huawei Ability Gallery sends a POST request in the following format to the receving URL address specified in the console, and in its response, the mobile application’s login page is returned deepLink with the OpenId.

4- Example of deepLink returned by Backend:

hwapp://com.huawei.hag/openId=xxxx

For sample response body, please visit following web site;

https://developer.huawei.com/consumer/en/doc/development/service/hag-guide-accountbinding-card#inf14

5- The user has been directed to the login page of the mobile application / HTML5 application.

6- The user has been logged in with Huawei ID.

7- In this step, the matching of the OpenId assigned by HAG should be performed, which ensures that the user is associated with the UID / AccountId.

a. The developer adds the OpenId of the same user to the User UID in his DB.

8- Finally, the binding result must be reported to the Huawei Ability Gallery Server via an API. The format of the API request to be sent for the result notification is shared in the document at https://developer.huawei.com/consumer/en/doc/5060447#m1

Result

Account Binding Operation

--

--