PushizoDocs
Channels

Location-based targeting

With the user's permission, you can collect the device location and build segments such as "users within X km of this point" (ADR-0025).

With the user's permission, you can collect the device location and build segments such as "users within X km of this point" (docs/adr/0025-hms-flutter-web-catalyst-konum.md).

Principles (KVKK)

  • Location is sent only while the app is in the foreground, after the operating system permission has been granted and your app has called Location.setShared(true). No coordinates are collected in the background. (KVKK is the Turkish data protection law.)
  • If optional background region monitoring is enabled, the operating system monitors the regions; no coordinates are sent to the server, only region entries and exits are reported.
  • The moment of first sharing is stored as an explicit consent record (location_consent_at).
  • When Location.setShared(false) is called, the location and the consent record are deleted on the server immediately.
  • Coordinates are rounded to 5 decimal places (≈1 m); the SDK updates at most once every 5 minutes.
  • Before the permission prompt, show the user an explanation of why the location is requested (the SDK's requestPermission accepts an optional rationale text).

SDK

Pushizo.Location.requestPermission(activity, rationale = "For store offers near you")
Pushizo.Location.setShared(true)
Pushizo.Location.requestPermission()
Pushizo.Location.setShared(true)
await Pushizo.Location.requestPermission();
Pushizo.Location.setShared(true);

Details and other platforms: Android, iOS, Flutter, the Web SDK and the bridge READMEs. On iOS, add NSLocationWhenInUseUsageDescription to Info.plist.

Segment

Segments → New → Add condition → Location:

OperatorMeaning
within radiusLatitude, longitude and radius (0.1–1000 km); "Use my location" fills in the browser location
is setDevices that share their location
is not setDevices that do not share their location

API definition:

{ "all": [{ "field": "location", "op": "within_radius", "lat": 41.0082, "lng": 28.9784, "radius_km": 5, "days": 7 }] }

days is optional: it counts only locations updated in the last N days. Users who do not share their location never match this condition.

Region entry and exit

To start journeys from the shared location, see the Geofences page.

Server side

The location arrives with the SDK's subscription update (PATCH /sdk/v1/apps/{appId}/subscriptions/{id}, location: { lat, lng, accuracy_m } | null). In the dashboard, the subscription row on the user detail page shows the approximate location and update time; public API subscription responses include the location field.

On this page