react-native-ibeacon-simulator icon indicating copy to clipboard operation
react-native-ibeacon-simulator copied to clipboard

Error When Launching

Open marktyers opened this issue 4 years ago • 1 comments

When an iOS app launches either on the phone or simulator it throws the error:

I saved the index.ios.js file as iBeacon.js

import React, { Component } from 'react'
import { Text, View } from 'react-native'
import ibeacon from './ibeacon'

export default class App extends Component {
	componentWillMount() {
		const uuid = '04bc1d42-98be-4031-a4a9-50c76cb3e1b9'
		const identifier = 'com.myapp'
		ibeacon.startAdvertisingBeaconWithString(uuid, identifier, 0, 0)
	}
	render() {
		return (<View><Text>iBeacon</Text></View>)
	}
}

However I get the following error in the terminal (and on the screen of the connected iPhone 6S running iOS13:

Warning: %s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI., RootErrorBoundary
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- ... 28 more stack frames from framework internals

TypeError: null is not an object (evaluating 'NativeBeaconBroadcast.startSharedAdvertisingBeaconWithString')
* ibeacon.js:19:26 in startAdvertisingBeaconWithString
* App.js:12:43 in componentWillMount
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:7430:4 in callComponentWillMount
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:7576:27 in mountClassInstance
- ... 19 more stack frames from framework internals

I've tried debugging but can't figure out why this is happening...

marktyers avatar Dec 08 '19 21:12 marktyers