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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aibee/rn-nav-sdk

v1.0.4

Published

React Native navigation SDK providing native device capabilities for H5 applications in WebView

Downloads

337

Readme

@aibee/rn-nav-sdk

@aibee/rn-nav-sdk 是一个面向第三方接入的 React Native 导航 SDK。

它通过 NavWebview 组件为 WebView 中的 H5 页面注入导航相关的原生能力,支持在 iOS 和 Android 上承载导航页面加载与设备能力接入。

安装

SDK 依赖 react-native-webview,请一并安装:

pnpm add @aibee/rn-nav-sdk react-native-webview

使用 iOS 时还需要:

cd ios && pod install

NavWebview 参数

NavWebview 继承 react-native-webviewWebViewProps,原生属性(sourcestyleonLoadEndjavaScriptEnabled 等)直接透传。SDK 参数如下:

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | source | WebViewProps['source'] | 是 | H5 页面地址。使用自动寻车流程时 URL 需带 from=1 参数 | | back | () => void | 是 | 路由返回方法,由宿主实现(SDK 不集成路由)。H5 通过 JSBridge AIBEENav.back() 触发 | | searchConfig | OnSearchNavigationConfig | 是 | 结构 { range, coordinates, parkingLotId? }range 为室内范围多边形顶点,coordinates 为候选目标点,均为高德 GCJ-02 坐标 | | sdkConfig | Partial<SDKConfig> | 是 | { gaodeAndroidAppKey, gaodeIOSAppKey, gaodeRegion? }。App Key 从高德开放平台申请 gaodeRegion'MAINLAND' \| 'HONG_KONG' | | h5PreloadRemainingTimeThreshold | number | 否 | 高德导航剩余时间 ≤ 该值(秒)时预加载室内 H5 ,默认 30 |

示例

import { NavWebview } from '@aibee/rn-nav-sdk';
import type { OnSearchNavigationConfig } from '@aibee/rn-nav-sdk';

const searchConfig: OnSearchNavigationConfig = {
  range: [
    { latitude: 40.076546, longitude: 116.245131 },
    { latitude: 40.076807, longitude: 116.245755 },
    { latitude: 40.075602, longitude: 116.245552 },
    { latitude: 40.075799, longitude: 116.2463 },
  ],
  coordinates: [{ latitude: 40.076152, longitude: 116.245494 }],
};

<NavWebview
  source={{ uri: 'https://your-h5-url?from=1' }}
  back={() => navigation.goBack()}
  searchConfig={searchConfig}
  sdkConfig={{
    gaodeAndroidAppKey: '<your-android-key>',
    gaodeIOSAppKey: '<your-ios-key>',
    gaodeRegion: 'MAINLAND',
  }}
/>

其余 props(事件回调、onLog 调试日志、loadingComponent 自定义 loading 等)均为可选,按需参阅 NavWebviewProps 类型定义(src/components/NavWebview.tsx)。

平台配置

iOS(必需)

在宿主应用 Info.plist 中添加:

<!-- 后台定位模式(缺失会触发断言崩溃) -->
<key>UIBackgroundModes</key>
<array>
    <string>location</string>
</array>

<!-- 定位权限描述 -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>需要获取您的位置信息用于寻车导航和室内定位</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>需要获取您的位置信息用于后台导航和室内定位</string>

<!-- 蓝牙权限描述(iBeacon 室内定位) -->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>需要蓝牙权限用于扫描 iBeacon 进行室内定位</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>需要蓝牙权限用于扫描 iBeacon 进行室内定位</string>