Reputation: 165
I get an error if i use the following code. I have run a "pod install", link the library manually. Nothing works.
import React, {Component} from 'react';
import {
Text,
TouchableOpacity, View
} from 'react-native';
// @ts-ignore
import {Beacons} from 'react-native-beacons-manager';
export default class App extends Component {
componentDidMount() {
Beacons.requestWhenInUseAuthorization();
// Beacons.requestAlwaysAuthorization();
// Beacons.allowsBackgroundLocationUpdates(true);
}
render() {
return (
<View>
<Text style={{color: 'white', top: 150}}>test</Text>
</View>
)
}
};
Does somebody know why the error occurs?
Upvotes: 1
Views: 738
Reputation: 3067
IOS
For IOS we need to link it manually. Follow next steps:
RNiBeacon.xcodeproj
from node_modules/react-native-beacons-manager/ios
to Libraries
folder in xcode"$(SRCROOT)/node_modules/react-native-beacons-manager/ios"
to Headers Search Paths for your App$(SRCROOT)/../../../../ios/Pods/Headers/Public/React-Core
, $(SRCROOT)/../../../../ios/Pods/Headers/Public/Yoga
, $(SRCROOT)/../../../../ios/Pods/Headers/Public/YogaKit
to Headers Search Paths for RNiBeacon:Android
This library doesn't support new versions of react native for Android. You need to use forks: https://github.com/MacKentoch/react-native-beacons-manager/issues/249
https://github.com/MacKentoch/react-native-beacons-manager/issues/228#issuecomment-964131282
https://github.com/benlui/react-native-beacons-manager
depends on your need
Upvotes: 1