New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-ai-navigation-sdk

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-ai-navigation-sdk

A react native wrapper around combain ai navigation sdk

latest
npmnpm
Version
0.4.10
Version published
Maintainers
0
Created
Source

react-native-ai-navigation-sdk

A react native wrapper around combain ai navigation sdk

Installation

npm install react-native-ai-navigation-sdk

Usage

import { initSDK } from 'react-native-ai-navigation-sdk';

// ...
const sync: SyncingInterval = {
  interval: 1,
};

const routingConfig: ReactRoutingConfig = {
  routableNodesOptions: ReactRoutableNodesOptions.All,
};

const indoorNavigationSDKConfig: ReactIndoorNavigationSDKConfig = {
  apiKey: "API-key",
  routingConfig: routingConfig,
  syncingInterval: sync,
};

const initializeSDK = async () => {
  try {
    await initSDK(indoorNavigationSDKConfig);
    console.log('SDK initialized');
    await start()
    console.log("SDK STARTED")
  } catch (error) {
    console.error('SDK initialization error:', error);
  }
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Installation

todo: https://github.com/zoontek/react-native-permissions?tab=readme-ov-file#expo Made with create-react-native-library

Android installment

Currently only works with android

In react native without expo

Go to the prebuild android folder, change minSDK version from 23 to 28

add following to the build.gradle folder in the app directory


 repositories {
    mavenCentral()
    google()
    maven{
      url "https://gitlab.com/api/v4/projects/3194773/packages/maven"
    }

  }

If you are running an expo application generate an android prebuild by running

npx expo run:android

Does not work with expo go, need to run the sdk in native apps Use the generated prebuild and do the same steps as in react app without expo

React native eventlisteners

For the native code to communciate back to the JS implementation, the js has to listen to certain events by calling

const eventListener = DeviceEventEmitter.addListener('eventName', (params) => {
  setParam(param);
});

Each event will give a param which is a readableMap that can be used to match certain datatypes in the SDK

Event Types in React Native AI Indoor SDK

The React Native AI Indoor SDK provides various events to help you track and manage different aspects of the indoor navigation system. Below is a list of the available event types:

  • routeUpdated Triggered when the route information is updated. Will return ReactNativeRoutingPositionas param

  • nextScanTimeUpdate Indicates the next scan time update. Will return number as param but to extract the number simply do param.nextScan

  • newModelUpdate Signifies an update to the model. Will return string as param but to extract the number simply do param.modelType

  • wifiUpdate Signifies an update to the wifi pipe results. Will return ReactNativeWifiPipeResult as param

  • bleUpdate Relates to updates in Bluetooth pipe results. Will return ReactNativeBLePipeResult as param

  • newGpsLocationUpdate Reflects a new GPS location update. Will return ReactNativeGpsLocation as param

  • localLookUpPipeResultUpdate Updates related to local lookup results. Will return ReactNativeLookUpPipeResult as param

  • confidenceScoreUpdate Indicates a change in the confidence score. Will return number as param to extract the number call param.confidenceScore

  • usingGPSUpdate Shows updates on the usage of GPS. Returns if gps is used for positioning or not as param

iOS setup

Permissiosn

To setup iOS permissions some setup is needed, first add this to your Podfile:

```diff
# Transform this into a `node_require` generic function:
- # Resolve react_native_pods.rb with node to allow for hoisting
- require Pod::Executable.execute_command('node', ['-p',
-   'require.resolve(
-     "react-native/scripts/react_native_pods.rb",
-     {paths: [process.argv[1]]},
-   )', __dir__]).strip

+ def node_require(script)
+   # Resolve script with node to allow for hoisting
+   require Pod::Executable.execute_command('node', ['-p',
+     "require.resolve(
+       '#{script}',
+       {paths: [process.argv[1]]},
+     )", __dir__]).strip
+ end

# Use it to require both react-native's and this package's scripts:
+ node_require('react-native/scripts/react_native_pods.rb')
+ node_require('react-native-permissions/scripts/setup.rb')

+ setup_permissions([
+   'LocationWhenInUse',
+   'Motion',
+ ])

Then execute pod install in your ios directory

Then add these keys to your Info.plist

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need this permisison to determine your location</string>
<key>NSMotionUsageDescription</key>
<string>We need this permisison to determine your location</string>

Keywords

react-native

FAQs

Package last updated on 09 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts