react-native-ble-advertiser icon indicating copy to clipboard operation
react-native-ble-advertiser copied to clipboard

BLEAdvertiser is null after importing

Open lnogueir opened this issue 2 years ago • 7 comments

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!

lnogueir avatar Jul 06 '22 05:07 lnogueir

Does the example folder run that iOS phone?

vitorpamplona avatar Jul 06 '22 13:07 vitorpamplona

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

themorlock avatar Sep 25 '22 05:09 themorlock

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

vitorpamplona avatar Sep 27 '22 15:09 vitorpamplona

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

themorlock avatar Sep 29 '22 02:09 themorlock

@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

Zero6d avatar Nov 02 '22 03:11 Zero6d

same here after update to RN 0.69.7

AstanyTR avatar Dec 22 '22 18:12 AstanyTR

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'

maulanakurniawan avatar Mar 30 '23 20:03 maulanakurniawan