Integration: In-App Purchase Manager

What it does

When mam-inapp-purchase-manager is active, mam-geodirectory registers a callback on the mam_iap_require_iap filter (owned by mam-inapp-purchase-manager). The callback decides whether the IAP gate should apply to the current user.

The intent: a venue owner or staff member should not be asked to subscribe to view content on their own listing. Without this integration, an owner who happens to not have an IAP subscription would be locked out of their own data.


Activation

Two things must be true:

  1. mam-inapp-purchase-manager is active and consults mam_iap_require_iap to decide whether to gate the user.
  2. Under Mobile App Manager → Geodirectory → Settings, the toggle Exclude author and staff from In App Purchases? (gd-no-iap-for-author-staff) is set to yes.

How the bypass works

The plugin’s mam_gd_staff_manager::apply_in_app_purchase($require_iap) runs:

  1. Reads the current user’s mam_staff_ user meta keys, which list the listings on which the user is staff. (The naming pattern is mam_staff_{listing_id}; presence of any such meta means the user is staff somewhere.)
  2. If the user has any staff meta, returns false (no IAP required).
  3. Otherwise returns the upstream value unchanged.

The check does not currently inspect the listing’s gd-no-iap-for-author-staff toggle — the option is set in the admin UI but the runtime always returns false for any staff user. This is consistent with the intent (any staff member is exempted) but is worth knowing.

The mam_geodirectory_phone_data::inject_pending_invite_form() code also unsets inapp_is_required on the data array when a user has a pending invite — so users who are about to become staff are also exempted on app launch.


What the user experiences

  • A user with at least one entry in their mam_staff_* user meta opens the app and is not asked to subscribe.
  • A user with a pending staff invite is not asked to subscribe on the launch where the Manage Invites form is shown.
  • A user with neither sees the standard IAP gate (controlled by mam-inapp-purchase-manager).

Things to watch for

  • The toggle is informational at runtime. Disabling gd-no-iap-for-author-staff does not currently re-enable IAP for staff. To prevent the bypass entirely, remove mam_gd_staff_manager::apply_in_app_purchase from the filter chain.
  • The check is staff-only. Listing owners who are not also enrolled as staff/manager via the chat-manager invite system will not be exempted by this integration. In normal flows, owners are added to the listing_staff group automatically; this is more of a corner case for old data.
  • Admins are not exempted by this integration. The IAP plugin typically already exempts admins on its own.

Steps to enable

  1. Install and activate mam-inapp-purchase-manager.
  2. Set gd-no-iap-for-author-staff to yes under Settings.
  3. Verify a test staff member (with mam_staff_{listing_id} user meta set) is not prompted to subscribe.
  4. Verify a test user with a pending invite is not prompted on the launch where the invite form appears.

Verification

This article was last verified against:

  • Plugin: mam-geodirectory v2.1.5
  • Plugin: mam-inapp-purchase-manager
  • Source: includes/mam_gd_staff_manager.phpapply_in_app_purchase()
  • Source: includes/mam_geodirectory_phone_data.phpinject_pending_invite_form()

Re-verify whenever the mam_staff_{listing_id} user meta naming changes, the IAP plugin’s mam_iap_require_iap filter contract changes, or inject_pending_invite_form() stops unsetting inapp_is_required.


  • Plugin: mam-geodirectory
  • Recipe: Configure the GeoDirectory settings page
  • Form: Manage staff invitation

Metadata

Field Value
Article type Plugin Overview
Plugin slug mam-geodirectory
Applies to plugin version 2.1.5+
Category Plugin Reference
Audience WordPress admin
Last verified 2026-05-01
Contents

    Need Support?

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