Skip to content

Commit 7290e56

Browse files
committed
Doc update
1 parent 81a4b04 commit 7290e56

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,37 @@ export default class Screen extends Component {
245245
}
246246
```
247247
248+
### Test Visits
249+
250+
Test arrival visits can be fired with the method `PilgrimSdk.fireTestVisit`. You must pass a location to be used for the test visit. The arrival notification will be received via [Webhooks](https://developer.foursquare.com/docs/pilgrim-sdk/webhooks) and other [third-party integrations](https://developer.foursquare.com/docs/pilgrim-sdk/integrations)
251+
252+
```javascript
253+
import React, { Component } from 'react';
254+
import { Button } from 'react-native';
255+
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
256+
257+
export default class Screen extends Component {
258+
fireTestVisit = async function () {
259+
navigator.geolocation.getCurrentPosition((position) => {
260+
const latitude = position.coords.latitude;
261+
const longitude = position.coords.longitude;
262+
PilgrimSdk.fireTestVisit(latitude, longitude);
263+
Alert.alert("Pilgrim SDK", `Sent test visit with location: (${latitude},${longitude})`);
264+
}, err => {
265+
Alert.alert("Pilgrim SDK", `${err}`);
266+
});
267+
}
268+
269+
render() {
270+
return (
271+
<>
272+
<Button title="Fire Test Visit" onPress={() => { this.fireTestVisit(); }} />
273+
</>
274+
);
275+
}
276+
}
277+
```
278+
248279
## FAQ
249280
250281
Consult the Pilgrim documentation [here](https://developer.foursquare.com/docs/pilgrim-sdk/FAQ)

0 commit comments

Comments
 (0)