Foursquare LogoFoursquare Developers Logo

One of the best ways to help us improve the accuracy of the Pilgrim SDK and where we think devices are located is by providing feedback about a user's visit. The more feedback we get, the smarter, faster and more accurate visits from the Pilgrim SDK become. We provide the following methods to provide feedback.

Confirm and Deny a Visit

You can easily confirm whether a visit is accurate or not (and why). All you need is the pilgrimVisitId from the original visit.

/**
 *  @param visitId          The visit ID to provide feedback for.
 *  @param feedback         See FSQPVisitFeedback below for options.
 *  @param actualVenueId    If the correct Foursquare venue ID is known, let pilgrim know.
 *  @param completion       A completion handler called when the transaction finishes.
 */

PilgrimManager.shared().feedbackProvider.leaveVisitFeedback(feedback: FeedbackProvider.VisitFeedback, visitId: String, actualVenueId: String?, completion: ((Error?) -> Void)
/\*\*

- @param pilgrimVisitId The visit ID from the notification that is sent to you.
-                        Note not all enter notifications have visit ids.
- @param feedback The type of feedback you want to leave for the visit
- @param actualVenueId If you were at another venue than the one you were notified.
-                        Pass the actual venue ID here.
  \*/

public static void leaveVisitFeedback(@NonNull String pilgrimVisitId, @NonNull VisitFeedback feedback, @Nullable String actualVenueId)

The available feedback options are:

Feedback Description
VisitFeedback.confirm The visit was at the correct venue.
VisitFeedback.falseStop The user did not stop anywhere. If you are unsure, use deny
VisitFeedback.wrongVenue The wrong venue was detected. A Foursquare venue id can optionally be included to identify the correct venue.
VisitFeedback.deny Generic feedback that something was incorrect. If your feedback interface doesn’t allow for wrongVenue or falseStop or you are unsure, use this.
Feedback Description
VisitFeedback.CONFIRM The visit was at the correct venue.
VisitFeedback.FALSE_STOP The user did not stop anywhere. If you are unsure, use DENY
VisitFeedback.WRONG_VENUE The wrong venue was detected. A Foursquare venue id can optionally be included to identify the correct venue.
VisitFeedback.DENY Generic feedback that something was incorrect. If your feedback UX doesn’t allow for WRONG_VENUE, use this.
An example providing `wrongVenue` feedback with the correct venueId:
PilgrimManager.shared().feedbackProvider?.leaveVisitFeedback(feedback: .wrongVenue,
                                                             visitId: visit.pilgrimVisitId,
                                                             actualVenueId: "4ed92126f5b92139871ce962",
                                                             completion: nil)
PilgrimSdk.leaveVisitFeedback(visitId, VisitFeedback.WRONG_VENUE, "4ed92126f5b92139871ce962");

A more robust example of how you might add a feedback drawer to easily allow users to confirm or deny the accuracy of their visit on iOS can be found here.

Check-in at a - Foursquare - Venue

If you know a device is at a specific Foursquare venue, irrespective of receiving a Pilgrim Visit, you can also inform Pilgrim by providing the Foursquare venue ID:

/**
 *  @param venueId    The foursquare venue ID where you believe the device is currently at.
 */

PilgrimManager.shared().feedbackProvider?.checkIn(venueId: String)
/\*\*

- @param venueId The foursquare venue ID where you believe the device is currently at.
  \*/
  checkInWithVenueId(@NonNull final String venueId)

An example:

let foursquareHQVenueId = "4ef0e7cf7beb5932d5bdeb4e";
PilgrimManager.shared().feedbackProvider?.checkIn(venueId: foursquareHQVenueId)
final String foursquareHQVenueId = "4ef0e7cf7beb5932d5bdeb4e";
PilgrimSdk.checkInWithVenueId(foursquareHQVenueId);

Check-in at a - Partner - Venue

For partners that have already harmonized their venues with Foursquare, irrespective of receiving a Pilgrim Visit, you can also inform Pilgrim that a device is at a venue by providing the partner's harmonized venue ID:

/**
 *  @param partnerVenueId   A partner venue ID, that is harmonized with Foursquare, where you believe the device is currently at.
 */

PilgrimManager.shared().feedbackProvider?.checkIn(partnerVenueId: String)
/**
  * @param venueId A partner venue ID, that is harmonized with Foursquare, where you believe the device is currently at.
  */
  checkInAtVenueWithPartnerVenueId(@NonNull final String venueId)

An example:

// (string) where venueId is a previously set variable that consists of an existing harmonized partner's venue ID.
PilgrimManager.shared().feedbackProvider?.checkIn(partnerVenueId: venueId)
// (string) venueId is a previously set variable that consists of an existing harmonized partner's venue ID.
PilgrimSdk.checkInAtVenueWithPartnerVenueId(venueId);

Next Steps

FAQ