vitorpamplona / react-native-ble-advertiser

Bluetooth Advertiser/Scanner for React Native.
60 stars 38 forks source link

BLEAdvertiser is null after importing #40

Open lnogueir opened 2 years ago

lnogueir commented 2 years ago

Hi, I am trying to set up the basic example described in the Advertiser section of the README.

But I get this: image

This seems to be the same as issue #24, but there is no resolution there.

I only face this issue on iOS.

Thanks!

vitorpamplona commented 2 years ago

Does the example folder run that iOS phone?

themorlock commented 2 years ago

I'm having the same issue. The example doesn't run either.

vitorpamplona commented 2 years ago

Version 0.0.17 released. It seems to be working well on my devices. Let me know if you see any issues.

themorlock commented 2 years ago

Are you running in Expo? I'm using a development build so it should run. I'm still getting the 'null is not an object' error.

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import BLEAdvertiser from 'react-native-ble-advertiser';

export default function App() {

  BLEAdvertiser.setCompanyId(0x00);

  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

unnamed

Zero6d commented 2 years ago

@vitorpamplona still facing the problem in ios TypeError: Cannot read property 'setCompanyId' of null, js engine: hermes', reason: 'Unhandled JS Exception: TypeError: Cannot read property 'setCompanyId' of null, js engine: hermes

AstanyTR commented 1 year ago

same here after update to RN 0.69.7

maulanakurniawan commented 1 year ago

For some reason, you need to add below entry into your Podfile manually to make it work. Put it inside your app target, then run pod install

pod 'react-native-ble-advertiser', :path => '../node_modules/react-native-ble-advertiser/ios'