如何确保用户在使用React本机地图时不会使用模拟位置和伪造的gps?
在设备上启用开发人员模式后,用户仍然可以使用模拟位置,我们有办法停止它吗?
<MapView
provider={PROVIDER_GOOGLE}
ref={ map => { this.map = map }}
region={this.state.mapRegion}
//onRegionChangeComplete={region => this.setState({ region })}
style={{height: this.state.height}}
showsUserLocation = {false}
followUserLocation = {true}
showsMyLocationButton={false}
onMapReady={this.onMapReady}
zoomEnabled = {true}>
{this.state.geoFenceCoords!=undefined && this.state.geoFenceCoords.map((coords,i) => (
<MapView.Polygon
key={i}
coordinates={coords}
strokeColor="rgb(84,181,64)"
strokeWidth={2}
fillColor="rgba(84,181,64,0.2)"
onPress={() => this.onPress()}
/>
)
)}
{this.state.lastLat!=null && this.state.lastLong!=null && <MapView.Marker
coordinate={{
latitude: this.state.lastLat,
longitude: this.state.lastLong,}}
>
<View style={{justifyContent:'center', alignItems:'center',}}>
<View style={styles.calloutViewPin}>
{this.state.lastLat!= null && this.state.lastLong!=null && <Text style={styles.textLocPin}>Your current location
</Text>}
</View>
<Image source={marker} style={{width: 20, height: 30, paddingTop: 0, marginTop:0}}/>
</View>
</MapView.Marker>}
</MapView>
答案 0 :(得分:1)