Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

BLEAdvertiser is null after importing #40

Open
lnogueir opened this issue Jul 6, 2022 · 7 comments
Open

BLEAdvertiser is null after importing #40

lnogueir opened this issue Jul 6, 2022 · 7 comments

Comments

@lnogueir
Copy link

lnogueir commented Jul 6, 2022

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
Copy link
Owner

Does the example folder run that iOS phone?

@themorlock
Copy link

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

@vitorpamplona
Copy link
Owner

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

@themorlock
Copy link

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
Copy link

Zero6d commented Nov 2, 2022

@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
Copy link

AstanyTR commented Dec 22, 2022

same here after update to RN 0.69.7

@maulanakurniawan
Copy link

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'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants