Requirements
Before creating your in-app message:- Add location tracking permissions to your app (for both Android and iOS).
- Refer to our Mobile SDK location reference for platform-specific setup instructions.
- Enable location sharing with OneSignal in your app code.
Create your message
1
Create your message
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.

Image showing in-app blocks and ability to add click actions alongside preview
Add the Location Permission Prompt Click Action
1
Add a button or image
Add a button or image with a clear call to action (e.g., “Enable Location”).
2
Add a click action
In the options:
- Click Add Click Action
- Select Location Permission Prompt
Both Android and iOS limit how frequently system-level prompts can appear. Using this soft pre-prompt helps avoid those limitations and allows for repeat attempts if needed.

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.Option 1: Time-based triggers
Show the message after a user has been in the app for a set amount of time (e.g., after 30 seconds).
Image showing session in-app trigger.
Option 2: Programmatic triggers
Control exactly when the prompt appears via the SDK:1
Add the trigger code to the app.
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.2
Add the trigger to the message
Set the same trigger key (
location_prompt
) and value (true
) in your in-app message settings.
Image showing programmatic In-app trigger.
Set the message frequency
To avoid spamming users:- Choose Multiple times
- Set a number of times to show the message
- Set a gap between each attempt

Example scheduling configuration for repeat prompts.
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.
You will start to see location points being tracked in your Users and Subscriptions pages.Create Location-triggered messages.