Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove referer prop #562

Merged
merged 2 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions GooglePlacesAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ export default class GooglePlacesAutocomplete extends Component {
}),
);

if (this.props.referer !== null) {
request.setRequestHeader('Referer', this.props.referer);
}

request.withCredentials = this.requestShouldUseWithCredentials();

request.send();
Expand Down Expand Up @@ -526,9 +522,6 @@ export default class GooglePlacesAutocomplete extends Component {
}

request.open('GET', url);
if (this.props.referer !== null) {
request.setRequestHeader('Referer', this.props.referer);
}

request.withCredentials = this.requestShouldUseWithCredentials();

Expand Down Expand Up @@ -598,9 +591,6 @@ export default class GooglePlacesAutocomplete extends Component {
'&' +
Qs.stringify(this.props.query),
);
if (this.props.referer !== null) {
request.setRequestHeader('Referer', this.props.referer);
}

request.withCredentials = this.requestShouldUseWithCredentials();

Expand Down Expand Up @@ -950,7 +940,6 @@ GooglePlacesAutocomplete.propTypes = {
numberOfLines: PropTypes.number,
onSubmitEditing: PropTypes.func,
editable: PropTypes.bool,
referer: PropTypes.string,
requestUrl: PropTypes.shape({
url: PropTypes.string,
useOnPlatform: PropTypes.oneOf(['web', 'all']),
Expand Down Expand Up @@ -1003,7 +992,6 @@ GooglePlacesAutocomplete.defaultProps = {
numberOfLines: 1,
onSubmitEditing: () => {},
editable: true,
referer: null,
};

// this function is still present in the library to be retrocompatible with version < 1.1.0
Expand Down
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,27 @@ Web support can be enabled via the `requestUrl` prop, by passing in a URL that y
- [x] typescript types
- [x] Current location

### Changelog

- 1.4.2+: Please see the [releases](https://github.com/FaridSafi/react-native-google-places-autocomplete/releases) tab for the changelog information.
- 1.3.9 : Multiple bugfixes + fixed breaking change in React Native.
- 1.3.6 : Fixed accuracy issue.
- 1.3.5 : Fixed bug where input was being cleared.
- 1.3.4 : Fixed bug where loading was breaking the component.
- 1.3.3 : Fixed `key prop` warning and added loading indicator.
- 1.3.2 : Added small feature which makes the request on `componentDidMount()` when you
already have the default value set.
- 1.3.1 : Update `react-native` peerDependecy. (> 0.46)
- 1.3.0 : Added support for React 16 (isMounted() and propTypes bugfix), support for restricted API key and moving from `ListView` to `Flatlist`.
- 1.2.12 : Fixed render description + docs.
- 1.2.11 : Fixed current location result `onPress` event.
- 1.2.10 : Set default `debounce` to `0`. Fixed debounce typing lag.
- 1.2.9 : Added `isRowScrollable` prop.
- 1.2.8 : Added `underlineColorAndroid`, `listUnderlayColor`, `renderLeftButton`, `renderRightButton` props. Added `nearbyPlacesAPI` option `None`.

### License
## Compatibility

This library does not use the iOS, Android or JS SDKs from Google. This comes with some Pros and Cons.

**Pros:**

- smaller app size
- better privacy for your users (although Google still tracks server calls)
- no need to keep up with sdk updates

**Cons:**

- the library is not compatible with a Application key restrictions
- doesn't work directly on the web without a proxy server
- any Google API change can be a breaking change for the library.

## Changelog

Please see the [releases](https://github.com/FaridSafi/react-native-google-places-autocomplete/releases) tab for the changelog information.

## License

[MIT](LICENSE)

Expand Down