Skip to content

dartnative_permissions: Permission.locationWhenInUse never shows the prompt and always reads restricted on iOS #117

Backlog

Description

@tayormi

Select your plan

Standard - priority support

Confirmations

  • I searched the existing issues and this is not a duplicate.

Framework or plugin?

Plugin

Plugin name and version

dartnative_permissions 1.0.1 (bundled with DartNative 1.10.0)

Platform

iOS

Public reproduction repo

https://github.com/tayormi/dn-issue-repros

Steps to reproduce

Permission.locationWhenInUse.request() never shows the system prompt, and both .status and .request() return restricted, even when CoreLocation says notDetermined and even after location has been allowed. restricted on iOS should only mean parental controls or MDM block location. A direct CLLocationManager request in the same build prompts at once with the same usage string, so the app's setup is fine.

Setup, in lib/repros/11_permissions_location.dart: Info.plist has NSLocationWhenInUseUsageDescription. Read status and Request call the plugin. As a control, Read native status and Request natively call CLLocationManager from AppDelegate.swift through dart:ffi, with no plugin involved.

  1. Reset the permission: xcrun simctl privacy <udid> reset location com.example.dnIssueRepros.
  2. Run dn run on an iOS simulator (seen on the iPhone Air, iOS 26.5 simulator) and tap 11 Location permission never prompts.
  3. Tap Read native status, Read status, then Request. CoreLocation says notDetermined; the plugin reads restricted; Request shows no prompt and returns restricted.
  4. Tap Request natively. The system prompt appears with the app's usage string. Tap Allow While Using App.
  5. Tap Read native status, Read status and Request again. CoreLocation says authorizedWhenInUse; the plugin still reads restricted.

Expected: denied (not determined) before asking, the system prompt on Request, and granted once location is allowed.

The device log shows no CLLocationManager activity from the plugin's request at all; the only one is the control's. A likely cause is a short-lived CLLocationManager (it has to stay alive until the delegate gets the answer) or a missing requestWhenInUseAuthorization() call, plus a status mapping that returns restricted by default.

Screenshots or video

Bug: no prompt, restricted Control: native request prompts Bug: still restricted after Allow

Logs

No response

dn doctor output

[!] DartNative (Channel stable, 1.10.0, on macOS 26.6 25G72 darwin-arm64, locale en-CA) [499ms]
    • DartNative version 1.10.0 on channel stable at ~/zero
    ! Warning: `flutter` on your path resolves to ~/Flutter/flutter/bin/flutter, which is not inside your current DartNative SDK checkout at ~/zero. Consider adding ~/zero/bin to the front of your path.
    ! Warning: `dart` on your path resolves to ~/Flutter/flutter/bin/dart, which is not inside your current DartNative SDK checkout at ~/zero. Consider adding ~/zero/bin to the front of your path.
    • Downloaded from https://cdn.dartnative.com; "dn upgrade" moves it to the newest release, "dn releases" lists the others
    • Framework revision bdfb466e6d1 (4 days ago), 2026-11-24 15:36:11 +0100
    • Framework edition b2263be6a0167213
    • Engine revision de099f669f
    • Dart version 3.12.0 (build 3.12.0-192.0.dev)
    • DevTools version 2.55.0
    • DartNative download mirror https://cdn.dartnative.com
    • Feature flags: enable-android, enable-ios, cli-animations, enable-native-assets, enable-lldb-debugging, enable-uiscene-migration
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 27.2) [938ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 27B52
    ! iOS 27.2 Simulator not installed; this may be necessary for iOS and macOS development.
      To download and install the platform, open Xcode, select Xcode > Settings > Components,
      and click the GET button for the required platform.

      For more information, please visit:
        https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
    • CocoaPods version 1.16.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions