Request location permissions with in-app messages

Prompt Android and iOS mobile app users to allow location tracking.

Easily request location access from users by using a OneSignal in-app message as a "soft prompt" before the required system-level location permission prompt appears. You can also instead programmatically trigger the system-level prompt with our Mobile SDK location methods.


Requirements

  • Add location tracking permissions to your app (Android/iOS).
  • Enable location sharing with OneSignal in your app code.

🔨

Developer setup required

Refer to our Mobile SDK location reference for platform-specific implementation details.


Create your message

  1. In the OneSignal dashboard, go to:
    Messages > In-App > New In-App
  2. Audience:
    • If all users should see the prompt, select Show to all users.
    • Otherwise, target a specific Segment.
  3. Message design:
    • Clearly explain why location access benefits the user.
      E.g., "Enable location to receive relevant local updates."
    • Be concise but specific to increase opt-in likelihood.
1922

Image showing in-app blocks and ability to add click actions alongside preview


Add the Location Permission Prompt Click Action

  1. Add a button with a clear call to action (e.g., “Enable Location”).
  2. Under button settings:
    • Click Add Click Action
    • Select Location Permission Prompt
      • When clicked, OneSignal triggers the native, required system-level location prompt.
      • If location is already enabled, the message won’t show to avoid unnecessary prompts.

📘

System level location prompt limitations

Android and iOS restrict how often native prompts can appear. Using a pre-prompt (like this) lets you retry opt-in attempts without these system limitations.

561

Image showing in-app blocks and ability to add click actions


Trigger the in-app message

You can control when and how the prompt is shown.

Time-based triggers

Allows you to display the in-app message after the user has been in the app for a certain period of time. For example, display after being in the app for 30 seconds.

1067

Image showing session in-app trigger.

Programmatic Triggers

Use our SDK's addTrigger method to set a key like location_prompt and value like true. Then call this whenever you want inside your app.

Put that same key:value into the In-App Trigger option.

Image showing programmatic In-app trigger.

Image showing programmatic In-app trigger.


Schedule

Set How often do you want to show this message? to Multiple times using any number you want and a gap of however long you want.

A good example would be to set 5 times with a gap of 4 weeks in between. This means the in-app will only show a total of 5 times (if they don't allow after 5 times, you likely won't convince them) and only display it every 4 weeks. This means the prompt will display roughly once a month for the first 5 months.

Image showing how often to set the cadence of the in-app message.

Image showing how often to set the cadence of the in-app message.


Best Practices

  • Always explain the benefit of location access to users.
  • Use segmentation or triggers to avoid asking at a bad time.
  • Pre-prompts increase opt-in rates and avoid operating system limits.
  • Ensure location permissions are correctly configured in your app before triggering the in-app message.

👍

Location prompt complete!

You will start to see location points being tracked in your Users and Subscriptions pages.

Start creating Location-triggered notifications.