【发布时间】:2020-05-21 09:10:14
【问题描述】:
我正在尝试在 React Native 中使用 BluetoothManager,已经完成了这些步骤:
- 我使用
react-native init MyProject进行了全新安装 - 在 App.js 中导入 NativeMoludes:
import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, NativeModules } from 'react-native'; - 初始化蓝牙管理器:
const { BluetoothManager} = NativeModules; - 在
return(...)之前执行alert(BluetoothManager);
但它总是提示空值。我是否错过了 RN 安装或导入中的某些内容? 我正在使用 React Native v.0.62.2。请指教。
【问题讨论】:
标签: react-native