@expofp/react-native-efp-sdk
v0.8.2
Published
ExpoFP React Native SDK
Readme
@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-sdkPrerequisites
- 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
- API Reference - TypeScript definitions
- ExpoFP Official Docs
Development
Setup
# Install dependencies
yarn
# Build the library
yarn prepare
# Type check
yarn typecheck
# Lint
yarn lint
# Test
yarn testBuilding Example App
# Android
yarn example build:android
# iOS
yarn example build:iosRunning Example App
# Android
yarn example android
# iOS
yarn example ios
# Start Metro bundler
yarn example startRequirements
| Platform | Version | |----------|---------| | React Native | >= 0.79.0 | | iOS | >= 12.0 | | Android | >= API 21 |
License
MIT
