react-native-beacons-manager
react-native-beacons-manager copied to clipboard
Compatibility with React Native 0.60
Version
1.0.7
Platform
iOS
OS version
iOS 13
Steps to reproduce
- yarn add react-native-beacons-manager
- react-native link react-native-beacons-manager
- ...others steps on iOS to background mode...
Expected behavior
Works
Actual behavior
iOS give me the error:
fatal error: 'React/RCTBridge.h' file not found
"react": "16.8.6", "react-native": "0.60.4", "react-native-beacons-manager": "^1.0.7"
Someone can help me?
same issue,
did you fix it?
Nothing at moment bro... using RN 59 and waiting for updates.
@RafaelFeiten @yoojeen126
This is how I made it works
Selected Libraries/RNiBeacon.xcodeproj
then on TARGETS select RNiBeacon
, look for Header Search Paths
and I added these paths
$(SRCROOT)/../../../../ios/Pods/Headers/Public/React-Core
$(SRCROOT)/../../../react-native/ReactCommon
Both are recursive
@RafaelFeiten @wasa4587 I tried downgrade RN 0.43.3 version like this example version, then woked fine. I think its maybe RN version compatibility problem with beacon manager.
@wasa4587 thank you, your suggestion worked! One of my mistake is that i added the lines in the search header debug and search header release not the father, i don't know if it is really related but its working. thanks!
Anyone has a suggestion on how to fix this? I've installed the library and linked it manually by running react-native link react-native-beacons-manager
I've also edited my react-native.config.js
to exclude them from pod install
.
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/app/static/fonts/'],
dependencies: {
'react-native-beacons-manager': {
platforms: {
android: null,
ios: null,
},
},
'react-native-bluetooth-state': {
platforms: {
android: null,
ios: null,
},
},
},
};
Tried @wasa4587 his solution, but unfortunately I still get an error when running the build in dev mode;
Running the latest version of RN. Anyone any idea?
You have a missing line in this list (which was there before I added the two lines @wasa4587 suggested).
This is a screenshot of how it should look like:
@rnnyrk did it worked to you? I have facing a similar issue (now it's limits.h file not found
) when trying to archive
The lastest version on npm doesn't have support for autolink, but the source on GitHub does, see:
https://github.com/MacKentoch/react-native-beacons-manager/issues/149#issuecomment-553488736
This way you will not require xcode manual configuration.
@niv-breez I did indeed fix it by using the version from Github instead of npm
I faced the same issue, fixed it by using @ptsteadman 's solution. Used react-native-bluetooth-status as an alternative for react-native-bluetooth-state, which was also breaking!
Hi everyone, My fix above not really fix the problem, the build failes again when archiving. We checked @ptsteadman solution to use the GitHub version instead the npm version and the library compiles perfectly but the beacons don't really work. I don't get events enter/exit to my app, as mentioned in one of the issues here.
So the solution we choose, which fixes everything the build+the beacons, is:
- copy react-native-beacons-manager.podspec file into node_modules/react-native-beacons-manager
- go to the ios directory, and run
pod install
- remove libRNiBeacon from 'Frameworks, Libraries, and Embedded Content' in xcode under "General" in breez_app build settings
.podspec file:
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = package['name'] s.version = package['version'] s.summary = package['description'] s.license = package['license'] s.authors = package['author'] s.homepage = package['homepage'] s.platform = :ios, "9.0" s.source = { :git => "https://github.com/MacKentoch/react-native-beacons-manager.git", :tag => "v#{s.version}" } s.source_files = "ios/**/*.{h,m}" s.dependency 'React' end
Notes:
*You can also create a fork instead doing it every time
*It's a temporary solution until @MacKentoch will release a stable version to npm.
Any chance of getting an updated version on NPM?
@ptsteadman yeah its working, there is no issue but beacons are not detecting. here is my code:
startBeacon = () => {
// Alert.alert('','StartBeacon function')
Reactotron.log('startBeacon function');
if (Platform.OS === 'ios') {
Alert.alert('','IOS platform funtion')
Reactotron.log('iosPLatform');
const region = {
identifier: 'REGION1',
uuid: ''
};
DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
Alert.alert('','beacons monitering started')
if (data.beacons.length) {
this.setState({ detectedBeacons: data.beacons });
Alert.alert(Found beacons!
, JSON.stringify(data.beacons));
}
});
Beacons.startUpdatingLocation();
}
else{
Reactotron.log('else');
Beacons.detectIBeacons();
Beacons.detectAltBeacons();
Beacons.detectEstimotes();
Beacons.detectEddystoneUID();
Beacons.detectEddystoneTLM();
Beacons.detectEddystoneURL();
Beacons.startRangingBeaconsInRegion('REGION1')
.then((data) => {
Alert.alert('', `Beacons monitoring started!`);
})
.catch((error) => {
Alert.alert('', `Beacons start error!`);
});
DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
if (data.beacons.length) {
this.setState({ detectedBeacons: data.beacons });
Alert.alert(`Found beacons!`, JSON.stringify(data.beacons));
}
});
}
};
render() {
const { nearbyStores } = this.state;
const { beaconList } = this.props;
return (
<View>
<NavigationEvents
onWillFocus={() => {
StatusBar.setBarStyle('light-content', true);
if (beaconList.length) {
this.startBeacon();
}
}}
onWillBlur={() => {
if (beaconList.length) {
Beacons.stopRangingBeaconsInRegion('REGION1')
.then(() => {
Alert.alert('', `Beacons monitoring stopped succesfully!`);
})
.catch((error) => {
Alert.alert(`Beacons stop error!`);
});
}
StatusBar.setBarStyle('dark-content', true);
}}
/>