npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-hms-location

v1.0.1

Published

## Contents - Introduction - Installation Guide - React-Native SDK Method Definition - Configuration Description - Licensing and Terms

Downloads

3

Readme

react-native-hms-location

Contents

  • Introduction
  • Installation Guide
  • React-Native SDK Method Definition
  • Configuration Description
  • Licensing and Terms

1. Introduction

The React-Native SDK code encapsulates the Huawei location client interface. It provides many APIs for your reference or use.

The React-Native SDK code package is described as follows:

  • Android: core layer, bridging Location SDK bottom-layer code;
  • src/modules: Android interface layer, which is used to parse the received data, send requests and generate class instances.
  • index.js: external interface definition layer, which is used to define interface classes or reference files.

2. Installation Guide

Before using Reactive-Native SDK code, ensure that the RN development environment has been installed.

2.1 Copy the library into the demo project

In order to able the library to be used in the demo, the library should be copied under the node_modules folder of the project.

The structure should be like this

        hms-location-demo
            |_ node_modules
                |_ ...
                    react-native-hms-location
                    ...

2.2 Add location package to your application

import com.huawei.hms.rn.location.RNHMSLocationPackage

Then add the following line to your getPackages() method.

packages.add(new RNHMSLocationPackage()); 

2.3 Initialize the broadcast receiver within your app

Import the following classes to the MainActivity.java file of your project.

import com.huawei.hms.rn.location.RNHMSLocationPackage;
import com.huawei.hms.rn.location.helpers.HMSBroadcastReceiver;

Then add the following line to your onCreate() method:

HMSBroadcastReceiver.init(this, getReactNativeHost().getReactInstanceManager());

3. HUAWEI Location Kit SDK for React Native

Summary

| Fused Location | | | :-------------: | :-------------: | | LocationData | Object used used to store location data. | | LocationRequest | Object used to store location request information. | | LocationSettingsRequest | Object used for specifying the location service types and checking the location settings to obtain optimal functionality of all requested services. | | flushLocations | This API is used to update locations being processed. | | checkLocationSettings | This API is used to check whether related location settings are available. | | getLastLocation | This API is used to obtain the latest available location. | | getLastLocationWithAddress | This API is used to obtain the available location of the last request, including the detailed address information. | | getLocationAvailability | This API is used to check whether the location data is available. | | setMockLocation | This API is used to update locations being processed. | | setMockMode | This API is used to specify whether the location provider uses the location mock mode. If yes, the GPS or network location is not used and the location set through setMockLocation (Location) is directly returned. | | requestLocationUpdatesWithCallback | This API is used to request location updates. | | removeLocationUpdates | This API is used to remove location updates of the specified callback information. | | requestPermission | This API is used to request permission to use location services. | | hasPermission | This API is used to check if the permission to use location services has been granted. | | addFusedLocationEventListener | This method is used add a listener for fused location events. | | removeFusedLocationEventListener | This method is used to remove the listener added for fused location events. |

| Activity Identification | | | :-------------: | :-------------: | | ActivityConversionInfo | This object is used to store activity conversion information. | | ActivityConversionData | This object is used to store activity conversion event data. | | ActivityConversionRequest | This object is used to store activity conversion request information. | | ActivityConversionResponse | This object is used to store activity conversion result information. | | ActivityIdentificationData | This object is used to store activity identification event data. | | ActivityIdentificationResponse | This object is used to store activity identification result data. | | createActivityConversionUpdates | This API is used to activity conversions (entering and exit), for example, detecting user status change from walking to bicycling. | | createActivityIdentificationUpdates | This API is used to register for activity identification updates. | | deleteActivityConversionUpdates | This API is used to remove activity conversion updates associated with the given pendingIntent object. | | deleteActivityIdentificationUpdates | This API is used to remove all activity identification updates from the specified PendingIntent object. | | requestPermission | This API is used to request permission to use activity identification services. | | hasPermission | This API is used to check if the permission to use activity identfication services has been granted. | | addActivityIdentificationEventListener | This method is used add a listener for activity identification events. | | removeActivityIdentificationEventListener | This method is used to remove the listener added for activity identification events. | | addActivityConversionEventListener | This method is used add a listener for activity conversion events. | | removeActivityConversionEventListener | This method is used to remove the listener added for activity conversion events. |

| GeoFence | | | :-----: | :-------: | | GeofenceBuilder | This object is used to store geofence data. | | GeofenceRequest | This object is used to store geofence request information. | | GeofenceData | This object is used to store geofence event data. | | createGeofenceList | This API is used to add multiple geofences. | | deleteGeofenceList | This API is used to remove geofences by their request IDs. An error is reported if the list is empty. | | addGeofenceEventListener | This method is used add a listener for geofence events. | | removeGeofenceEventListener | This method is used to remove the listener added for activity conversion events.

4. Configure parameters.

No.

5. Licensing and Terms

Huawei Reactive-Native SDK uses the Apache 2.0 license.