@alex Would it be possible to allow custom apps to request phone location data the same way that they ask for something like camera access? I’ve tried some a couple times and haven’t been able to get the system prompt to allow access (on iOS).
We have a number of custom apps (time tracking, tool tracking, milage log) that would benefit from this feature. Our use case would obviously be opt-in per user, but I think that is how the location permissions are generally structured anyway.
I think this could also solve this use case if the form was a custom app rather than a native fibery form: Use current location in form view
Edit: AI Context (Are these kinds of things helpful or just annoying?)
FiberyMobile/1.3.0 (iOS): navigator.geolocation callbacks never fire inside Custom Apps (WKWebView)
Hi Fibery team — we are building a Custom App (platform 3.1.0) for field time, tool, and mileage tracking that uses navigator.geolocation.getCurrentPosition() and watchPosition().
Geolocation works as expected in Safari (macOS & iOS) and in Fibery Desktop (Electron/45.0.0 on macOS, using enableHighAccuracy: false once Fibery.app is enabled in macOS Location Services). However, in the iOS mobile app (FiberyMobile/1.3.0 on iOS 18.7), navigator.geolocation hangs silently without invoking either callback.
What we observed in FiberyMobile/1.3.0 (iOS)
- Silent hang (
CALLBACK_NEVER_FIRED):- Before calling geolocation,
await navigator.permissions.query({ name: "geolocation" })returnsstate: "prompt". - When
navigator.geolocation.getCurrentPosition(onSuccess, onError, options)orwatchPosition(...)is called, no iOS permission dialog is shown,navigator.permissions.query({ name: "geolocation" })immediately flips tostate: "denied", andWKWebViewnever invokesonSuccessoronError. - This happens both when calling
window.navigator.geolocationinside the Custom App<iframe>and when callingwindow.top.navigator.geolocationon the parent frame, with bothenableHighAccuracy: falseandenableHighAccuracy: true.
- Before calling geolocation,
- Missing
allow="geolocation"on the Custom App<iframe>:- Inspecting
window.frameElement.getAttribute("allow")from inside the Custom App returnsnull.
- Inspecting
- iOS Settings shows Location for Fibery, but only
"Never"and"When I Share":- Because
FiberyMobilealready includesNSLocationWhenInUseUsageDescriptioninInfo.plist, Location appears under iOS Settings → Apps → Fibery → Location, but iOS only offers “Never” and “Next Time Or When I Share” (no “While Using the App” option) until the native app triggersCLLocationManager.requestWhenInUseAuthorization().
- Because
Environment details
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 FiberyMobile/1.3.0
inIframe: true (iframe allow attribute: none)
isSecureContext: true
Permissions API: before="prompt" -> after="denied"
Result: neither success nor error callback fires
Requested fix
- Add
allow="geolocation"to the Custom App<iframe>container so embedded Custom Apps are permitted by the frame’sPermissions-Policy. - In the
FiberyMobileReact Native /WKWebViewshell, enable geolocation delegation for same-origin*.fibery.iocontent (geolocationEnabled={true}/WKUIDelegatepermission handling +CLLocationManager.requestWhenInUseAuthorization()) sonavigator.geolocationresolves in the mobile app.