What this button does
The Enable Location Services button gives your app users a simple way to reach the device’s location permission — a built-in content type you drop straight into your layout. Tap it, and the app opens the device’s own location settings, where a user can turn location on, or flip it back on after declining.
Here’s why that matters: the phone’s own location permission is essentially a one-time ask. Once a user declines it, your app can’t pop that system prompt again — the only way back is for them to flip the switch in their phone’s own Settings. An Enable Location Services button hands them a shortcut straight to that screen, so they never have to go hunting for it.
Pair this button with any feature in your app that depends on GPS, for instance:
- Map screens with markers
- Geofilters (filter content by the user’s city / nearby radius)
- Nearby listings, directory distance, or check-in features
Before you start
- You need WordPress admin access to Mobile App Manager.
mam-mainmust be active (the content class ships with MAM Main).- Decide where the button should appear — the main navigation tab bar or the left menu — and which user role(s) should see it. App content is configured per role.
- Decide what should fire the location prompt for your users. The Enable Location Services button opens the device location settings; it is a manual entry point, not the automatic permission rationale screen.
Add the button
Your app’s buttons all come together in one place: Mobile App Manager → App Setup, where each button is a single content element you place in either the main tab bar or the left menu, one role at a time.
- Open Mobile App Manager → App Setup.
- Choose the role whose app layout you want to edit (for example, the default
mam-allrole). - Choose the placement section — main navigation or left menu — depending on where you want the button.
- Add a new button and set its content type to Enable Location Services.
- This content type requires no per-button content settings — the App Setup form shows “No settings required”, and that’s by design: the button’s only job is opening the device’s location settings.
- Give it whatever label/title and icon you’d give any other button — for example, “Enable Location” with a map-pin icon — using the same design controls you already know.
- Save the App Setup layout.
Make sure GPS is actually enabled for the app
Adding the button only builds the in-app shortcut — for location features to actually work, your app build itself needs to declare and request location access. That comes down to two settings, both living outside the button itself:
- Turn on GPS for the app. In the app’s general settings, make sure the Use GPS option (
tsl-setting-use_gps) is turned on. Flipping this is what setsuse_gpstoyesin the publish payload — skip it, and the build ships without location capability at all. - Write the iOS permission string. iOS won’t let you publish without a plain-English reason for using location — that’s the GPS / location usage message (
ios_app_gps_message), set in the Publish Your App step. Apple’s reviewers reject anything vague here, so spell out why your app needs location (for example: “Used to show listings near you and filter results by your city”).
Test it
- Build or preview the app for the role you set up — the WPMAM Previewer App can render your App Setup layout without a full build.
- On a device with location off (or with permission previously denied), tap the Enable Location Services button.
- Confirm the device’s location settings open.
- Turn location on, return to the app, and check that your GPS-dependent screens (map, geofilters, nearby listings) now work as expected.
How it fits together
| Piece | Where it lives | Role |
|---|---|---|
| Enable Location Services button | App Setup → main tab bar or left menu, per role | In-app shortcut that opens the device location settings |
Use GPS (tsl-setting-use_gps) |
App general settings | Declares the app uses location; sets use_gps: yes in the publish payload |
GPS usage message (ios_app_gps_message) |
Publish Your App step | The iOS permission-rationale string Apple shows |
The button doesn’t hold on to any configuration of its own, and it doesn’t add anything to the per-button mobile payload beyond identifying itself as the open_location_preferences action. On the device, its entire job is routing the user to the OS location settings.
Related tasks
- Add a Map button to your app
- Enable Geofilters so users can filter content by city
- Publish your app (where the GPS usage message is set)
Verification
This article was drafted against:
mam-main/includes/content-classes/local-app-enable-location-services-content-class.php(content class definition:content_type = 'Enable Location Services',class = open_location_services,vc_type = open_location_preferences, no per-button settings)mam-main/includes/content-classes/README.md(content-class model and App Setup button placement)mam-main/includes/app-settings/mam-app-settings.php(use_gpsfromtsl-setting-use_gps;gps_messagefromios_app_gps_message)mam-main/includes/app-settings/local-app-app-setup-class.php(main vs. left-menu placement, per-role content)
Re-verify if the content-type label changes, if the class begins exposing per-button settings, or if the GPS enablement / permission-string settings are renamed or relocated in the admin UI.
