npm.io
0.8.19 • Published 1 week ago

@expofp/react-native-efp-sdk

Licence
MIT
Version
0.8.19
Deps
0
Size
216 kB
Vulns
0
Weekly
0

@expofp/react-native-efp-sdk

A React Native Turbo Module for integrating ExpoFP (Exhibition Floor Plan) SDKs with React Native applications. Provides native iOS and Android support for displaying and interacting with interactive floor plans.

Features

  • React Native Turbo Module - Modern architecture using the new React Native bridge
  • iOS Support - Built on ExpoFP iOS SDK v5
  • Android Support - Built on ExpoFP Android SDK v5
  • Native Performance - Direct access to native map rendering
  • TypeScript - Full type safety with TypeScript support

Installation

npm install @expofp/react-native-efp-sdk
# or
yarn add @expofp/react-native-efp-sdk
Prerequisites
  • iOS: CocoaPods, Ruby >= 3.0, Bundler >= 2.7
  • Android: Android SDK, Gradle
  • React Native: >= 0.79.0

Quick Start

Import and use the ExpofpView component to display an interactive floor plan:

import { useRef } from 'react';
import { View } from 'react-native';
import { ExpofpView, type ExpofpViewMethods } from '@expofp/react-native-efp-sdk';

export function FloorPlanScreen() {
  const mapRef = useRef<ExpofpViewMethods>(null);

  return (
    <View style={{ flex: 1 }}>
      <ExpofpView
        ref={mapRef}
        expoKey="YOUR_EXPO_KEY"
        style={{ flex: 1 }}
        onBoothClick={(booth) => {
          console.log('Booth clicked:', booth);
        }}
        onFloorActivated={(floor) => {
          console.log('Floor activated:', floor);
        }}
      />
    </View>
  );
}
Using View Methods

Access imperative methods through the component ref:

// Zoom controls
mapRef.current?.zoomIn();
mapRef.current?.zoomOut();

// Select booth or exhibitor
mapRef.current?.selectBooth('booth_id');
mapRef.current?.selectExhibitor('exhibitor_name');

// Highlight multiple booths
mapRef.current?.highlightBooths(['booth_1', 'booth_2']);

// Fit all elements in view
mapRef.current?.fitBounds();

Documentation

Development

Setup
# Install dependencies
yarn

# Build the library
yarn prepare

# Type check
yarn typecheck

# Lint
yarn lint

# Test
yarn test
Building Example App
# Android
yarn example build:android

# iOS
yarn example build:ios
Running Example App
# Android
yarn example android

# iOS
yarn example ios

# Start Metro bundler
yarn example start

Requirements

Platform Version
React Native >= 0.79.0
iOS >= 14.0
Android >= API 21
Android System WebView >= 101

Android System WebView 101+ is required at runtime. On devices with an older WebView, the plan fails to load and the error is delivered through the onPlanStatus event.

License

MIT

Support

Keywords