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

@armanatz/expo-hms-location

v1.0.2

Published

Expo config plugin to configure @hmscore/react-native-hms-location on prebuild

Downloads

22

Readme

@armanatz/expo-hms-location

This Expo config plugin auto-configures @hmscore/react-native-hms-location so that is can be used inside an Expo application that uses Continuous Native Generation.

Compatibility

This plugin is currently only for Android and there are no plans to add iOS support at the moment. I am open to PRs however so feel free to create one if you need iOS support.

This plugin was written and tested against Expo SDK 51.

It goes without saying but this plugin cannot be used in an "Expo Go" app as it requires custom native code.

Prerequisites

Ensure that you have a Huawei AppGallery Connect account and have created an Android project in there before using this plugin.

This is needed because you will require the agconnect-services.json file associated to your project.

Installation

First install the base React Native HMS Location package:

npm install --save @hmscore/react-native-hms-location

Then install this plugin:

npx expo install @armanatz/expo-hms-location

Configuration

Add @armanatz/expo-hms-location to your app's Expo config file (app.json, or app.config.js).

The plugin exposes the following options:

| Option | Type | Description | |--------------------------------|---------|-----------------------------------------------------------------------------| | agConnectServicesFile | string | Path to your agconnect-services.json file. | | isBackgroundLocationEnabled | boolean | (Optional) Enable location service in the background | | enableBouncyCastleFix | boolean | (Optional) If you get errors related to org.bouncycastle (like when using expo-updates), then set this to true |

!! IMPORTANT !!: The option agConnectServicesFile has to be provided, otherwise the prebuild will fail.


Example configuration:

"expo": {
  ...
  "plugins": [
      [
        "@armanatz/expo-hms-location",
        {
          "agConnectServicesFile": "./path/to/agconnect-services.json",
          "isBackgroundLocationEnabled": true,
          "enableBouncyCastleFix": true
        }
      ]
  ]
}

Post Configuration

After adding the plugin to your Expo config file, ensure you rebuild your app by running prebuild so that the plugin can apply its changes accordingly.

If all goes well, your app should now be able to use the @hmscore/react-native-hms-location package inside your Expo application.

Changes Made By This Plugin

  1. Copies your agconnect-services.json file to the android/app directory
  2. Extracts the App ID of your application from the agconnect-services.json
  3. Sets extracted App ID in AndroidManifest.xml
  4. Adds relevant location permissions in AndroidManifest.xml as per Huawei's docs
  5. Adds the Huawei Developer Maven repo to the project's build.gradle file
  6. Pins the Android Gradle Build Tools version to 8.6.0 (This is needed because the Huawei SDKs cause build errors without it)
  7. Adds the Huawei AGCP SDK to the project's build.gradle file
  8. Applies the Huawei AGConnect plugin inside the app's build.gradle file
  9. Adds the Huawei Location Kit SDK to the app's build.gradle file
  10. If enableBouncyCastleFix is set to true, will resolve org.bouncycastle dependency