Huawei Developers
Published in

Huawei Developers

A Novice Journey of Integrating Huawei Site Kit into Ionic Application ( Cross Platform Integration )

Introduction

HMS Site Kit Services

Ionic Framework

Demo

Prerequisite

cp node_modules/@hmscore/cordova-plugin-hms-ml/ionic/dist/hms-ml node_modules/@ionic-native/ -r
ionic build
npx cap init [appName] [appId]
apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
dependencies {implementation 'com.huawei.hms:site:5.0.0.300'}

Let’s Code

Avoid No Provider Error

Import

import { Component, IterableDiffers } from ‘@angular/core’;
import { HmsSite } from ‘@ionic-native/hms-site/ngx’;

Initializing the service

Place Search

Place Search Suggestion

Nearby Place Search

Widget Search

Run application

Conclusion

For more reference

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store