We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
GuidesLocation KitRESTPreparations

Preparations

Registering as a Developer

Before you get started, you must register as a Huawei developer and complete identity verification on HUAWEI Developers. For details, please refer to Registration and Verification.

Creating a Project

Follow instructions in Creating a Project to create a project.

Creating an App

Add an app to your project. For details, please refer to Adding an App to a Project. Set relevant parameters as follows:

  • Platform: Web
  • App name: Enter an app name.

Subscribing to a Pay-As-You-Go Plan

NOTE

To use the GeoLocation (API) and IPLocation (API) services, you need to subscribe to a pay-as-you-go plan.

From January 1, 2021, Huawei charges for some APIs of Location Kit. For details, please refer to Service Pricing. You need to go to Project settings > Project plan in AppGallery Connect to subscribe to a pay-as-you-go plan.

Enabling Location Kit

To use the GeoLocation (API) and IPLocation (API) services, you need to enable Location Kit switch in either of the following ways:

Enabling Location Kit on HUAWEI Developers

  1. Sign in to HUAWEI Developers and click Console in the upper right corner.
  2. Go to HMS API services > My APIs in the navigation pane on the left, select the project for which you want to enable Location Kit, and click Add API from library to go to the API library page.
  3. Click Location Kit under App Services. Click Enable to enable Location Kit.
  4. Go back to HMS API services > My APIs to view the list of services whose APIs have been enabled for the project.

Enabling Location Kit in AppGallery Connect

  1. Sign in to AppGallery Connect, click My projects, and select the project for which you want to enable Location Kit.
  2. Go to Project settings > Manage APIs, find Location Kit under Build, and toggle on the switch of this service.

Obtaining the API Key

To call a REST API, you need to pass the API key used by the service signature parameter to the request. To obtain the API key, perform the following steps:

  1. Sign in to AppGallery Connect and click My projects.
  2. Click the desired project in the project list and go to Project settings > General information.
  3. In the Project information area, click next to API key to copy the API key.

Search in Guides
Enter a keyword.