Add a favorites / check-in feature to listings

What you’ll build

By the end of this guide your app users will be able to:

  • Favorite a listing — tap a heart on any listing’s detail screen to save it, then return to a dedicated Favorites screen to see everything they’ve saved.
  • (Optionally) check in at a listing — confirm they are physically at a location, gated by a distance allowance you set.

Both features live in MAM Main and the content plugins built around it (like MAM GeoDirectory). They’re configuration, not code — you turn them on, place them in your app’s navigation, and style them to match. This guide walks through the admin steps, then points you to the developer hooks for teams that want to extend the behavior.

Heads up — “check-in” means two different things in MAM Suite. There’s a location check-in, where a user confirms they’re at a listing’s coordinates, and a team-invite check-in, where a user accepts or declines being added to a listing as staff. This guide covers favorites plus the location check-in. The team-invite accept/decline flow is a separate feature, documented under Form: Manage invite and the home-screen stack. Keep the two straight when you’re reading the settings labels.


Before you start

Requirement Notes
MAM Main active Favorites, the Favorites tab/content type, and the check-in ping endpoint all live in mam-main.
A listing content type in your app Favorites and check-in attach to listings — for example a directory built with MAM GeoDirectory, or any list-style content section. A plain article/post list also supports favorites.
Signed-in users Favorites and check-in are per-user. They require the app to have a signed-in app user (favorites are stored against the user, not the device).
Access to Mobile App Manager → App Setup This is where you place navigation items and toggle the listing/favorites settings.

Part 1 — Turn on favorites

How favorites works

Each listing detail screen can show a Favorites action button — a heart icon. When a signed-in user taps it, the app calls MAM Main’s favorites endpoint, which toggles that listing in their saved list. The next time the app refreshes its data, it gets the user’s current favorites list back in the JSON payload (the bundle of data your app downloads from your site) — so the heart shows filled or empty correctly no matter which device they’re on.

Under the hood:

  • The button is the built-in favorites tab-bar button (heart icon, action do_favorites).
  • Toggling sends the mam_manage_favorites AJAX subaction with a pingaction of favorite or unfavorite.
  • MAM Main stores the result in the user’s favorites user meta, and returns it to the app as the favorites key in the phone-data payload.
  • Content plugins can layer their own storage on top. MAM GeoDirectory, for example, also maintains per-listing favorite counts and a gd_user_favourite_post list, and exposes the mam_gd_manage_favorites action so developers can hook the event.

You do not configure any of that. You decide where the heart appears and how it looks.

Step 1 — Make sure the favorites button is shown on listings

On most listing content types, the favorites button shows up by default — but there’s a per-listing toggle if you’d rather turn it off:

  1. Go to Mobile App Manager → App Setup.
  2. Open the settings for your listings content section (the list/directory screen).
  3. Find Hide Favorites (setting listing_hide_favorites).
  4. Leave it set to No to show the heart on listing detail screens. Set it to Yes if you want listings with no favoriting at all.

In MAM GeoDirectory, the favorites button is intentionally hidden for a listing’s owner, manager, staff, and admin viewers — those users get owner-style action buttons instead of a consumer heart. That’s expected, not a bug; regular app users still see the heart just fine. See Listing tab bar buttons for the full role logic.

Step 2 — Add a Favorites screen so users can find what they saved

Saving a listing only helps if users can find their way back to it. MAM Suite ships a dedicated Favorites content type that renders the current user’s saved listings as a list.

  1. In App Setup, add a navigation item — either a tab bar item or a left menu item.
  2. Choose Favorites as the content type / source.
  3. There is nothing else to configure — the Favorites content type takes no settings. It automatically shows the listings the signed-in user has favorited.

There’s also a pre-built Favorites tab bar button ready to go (heart icon, title “Favorites”) — add it straight to your main tab bar in one step.

Step 3 — Style the heart and the Favorites screen

A handful of appearance settings let you fine-tune how favorites look and feel:

Setting (label) Variable What it controls
Favorite Icon Color fav_color The color of the heart icon in listing layouts.
Hide remove all favorites? hide_remove_all_favorites Hides the “remove all” control on the Favorites screen so users can’t clear the whole list at once.
Show Checkin on Map Header when tapped? map_show_listing_header_favorite Whether the listing-header control appears when a marker is tapped on the map. (Despite the variable name, the admin label reads “Checkin.”)
Favorite Listing Map Marker Pin URL map_pin_favorite_url A custom map pin image used for listings the user has favorited, so saved places stand out on the map.

You’ll find these scattered across the listings, favorites, and map setting groups in App Setup. Exact wording and grouping can shift a bit by version, so if one doesn’t turn up where you expect, search the App Setup settings for “favorite” and you’ll find it.

Tip — the Favorites screen reuses your list styling. The Favorites screen inherits the same layout/appearance settings as your regular listings screen, so a favorited listing looks the same on the Favorites tab as it does in the main directory. You generally don’t need to style it separately.

Step 4 — Verify

  1. Build/preview the app and sign in as a normal app user.
  2. Open a listing and tap the heart — it should fill in.
  3. Open the Favorites screen — the listing should appear.
  4. Tap the heart again to unfavorite, refresh, and confirm it leaves the Favorites list.

Part 2 — Add a location check-in (optional)

Favorites is “save for later.” Check-in is “I’m here now.” A check-in lets a signed-in user confirm they are physically at a listing’s location, optionally gated by how close they have to be.

Check-in is more situational than favorites — it suits event apps, loyalty/rewards apps, field-staff apps, and venue apps. If your app is a plain browse-and-save directory, you probably don’t need it. Skip ahead if that’s you.

How check-in works

When the app sends a check-in for a listing, MAM Main gets a checkinloc ping and fires its check-in actions (tsl_do_points_check_in, then tsl_do_check_in). What actually happens next — points awarded, attendance recorded, a reward unlocked — comes from whichever plugin or custom code is listening for those actions. MAM Main just supplies the trigger, plus the distance allowance the app checks before it sends; the reward logic is layered on top by something else.

There’s also a QR-code check-in option: give a listing a QR code, and scanning it from the app performs the check-in just the same. (In Gravity Forms-backed flows, this shows up as the QR Code Check-In field option.)

Step 1 — Set the distance allowance

This is the setting that decides how close someone has to be to a listing before they can check in.

  1. In App Setup, open the listings / activity settings group.
  2. Find Allowable Distance for Check in – Feet (0 or blank for infinite) (setting distance_for_check_in). Enter a radius in feet. 0 or blank allows check-in from anywhere (useful for testing or for non-geographic check-ins).
  3. Optionally set Allow override if not close enough to location? (distance_for_check_in_override) to Yes to let users check in even when they’re outside the radius — handy when GPS is imprecise.

Step 2 — (Optional) Add a daily check-in on app open

Some apps want a check-in once a day, every time a user opens the app — handy for attendance or streaks. These home-screen settings make that happen:

Setting (label) Variable Purpose
Check in Daily When Opening App require_daily_punch_in Prompts the user to check in once per day on launch.
Check In Button Title punch_in_button_title Label on the check-in button.
Check In Button Color punch_in_button_color Button color.
Punch in Message / Punch out Message punch_in_message / punch_out_message Confirmation text shown on check-in / check-out.
Check In section title main_checkin_header_title Heading for a check-in section on the home screen.

Don’t let the mixed terminology throw you — “Check In” and “punch in” refer to the same daily-presence mechanism. If you’re building for field staff clocking in and out, this is the settings group you want.

Step 3 — Provide the reward / outcome logic

Out of the box, MAM Main fires the check-in actions on a checkinloc ping — but what a check-in does (award points, mark attendance, unlock a coupon) is up to whatever’s listening. If your build includes a points/rewards plugin, set it up per that plugin’s docs. Need something custom instead? A developer can hook the check-in actions — see For developers below.

Step 4 — Verify

  1. Preview the app signed in as a normal user, standing in (or simulating) the listing’s location.
  2. Trigger the check-in (button or QR scan).
  3. Confirm the expected outcome fires (the confirmation message, points, etc.).
  4. Move outside the radius and confirm the gate behaves as configured (blocked, or overridable if you enabled override).

For developers

The no-code setup above covers most apps. When you need to go further, here’s where the hooks are:

  • mam_gd_manage_favorites (action, MAM GeoDirectory) — fires after a favorite is toggled. No arguments; read $_REQUEST['id'] (listing ID) and $_REQUEST['pingaction'] (favorite / unfavorite). Good for analytics or re-recommendation jobs. Runs synchronously right before the response is sent, so defer heavy work to WP-Cron. See Hook: mam_gd_manage_favorites.
  • tsl_do_check_in / tsl_do_points_check_in (actions, MAM Main) — fire when a checkinloc ping arrives. Add a listener to record attendance, award points, or unlock a reward. These are the seams a rewards/loyalty plugin plugs into.
  • Favorites storage — MAM Main stores the canonical per-user list in favorites user meta and returns it in the phone-data payload under the favorites key. MAM GeoDirectory additionally maintains per-listing favorite counts. Treat these meta keys as a frozen mobile contract; don’t rename them.

Troubleshooting

Symptom Likely cause
No heart on listings Hide Favorites is set to Yes for that content type, or the viewer is the listing’s owner/staff/admin (favorites is suppressed for them by design in GeoDirectory).
Heart appears but Favorites screen is empty No Favorites navigation item has been added, or the user isn’t signed in (favorites are per-user, not per-device).
Favorites don’t persist across devices The user is not signed in as the same app user. Favorites are tied to the user account, not the device.
Check-in always succeeds regardless of location Allowable Distance for Check in is 0 or blank (infinite), or Allow override is on.
Check-in records but “nothing happens” MAM Main fired the check-in actions, but no listener is providing the reward/outcome. Add the rewards plugin or a custom tsl_do_check_in handler.

  • Listing tab bar buttons (MAM GeoDirectory)
  • Mobile listing data shape
  • Hook: mam_gd_manage_favorites
  • Form: Manage invite (the separate team-invite “check-in” accept/decline flow)
  • Build a directory app (end-to-end tutorial)
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!