Skip to content

Fix: Add script for location permissions (Related to #50, #51) #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

yclw
Copy link
Contributor

@yclw yclw commented Apr 10, 2025

This PR adds scripts to provide a temporary workaround for the location permission issues experienced in macOS Sonoma (14) and Sequoia (15.1) as reported in #50 and #51. The core issue is that CLI applications cannot properly request or receive location permissions through the standard macOS permission system.

What This PR Includes

  • scripts/create_app.sh: Creates a macOS application wrapper for CoreLocationCLI that can properly request location permissions
  • scripts/install.sh: Installation script with options for Homebrew or source builds
  • scripts/README.md: Documentation explaining script usage and troubleshooting

How It Resolves Permission Issues

The core workaround creates a proper macOS .app bundle containing CoreLocationCLI. This app bundle:

  1. Has the necessary Info.plist entries for requesting location permissions
  2. Is opened once to trigger the system permission dialog
  3. For Homebrew installations, replaces the original CLI executable with the permission-enabled version

- Provides a workaround for GPS prompt issues
- Related to: fulldecent#50, fulldecent#51
@yclw yclw changed the title Temporary fix: Add script for location permissions (Related to #50, #51) Fix: Add script for location permissions (Related to #50, #51) Apr 10, 2025
@yclw
Copy link
Contributor Author

yclw commented Apr 11, 2025

Oh, I'm eager to resolve this issue as we need more user-friendly permission handling for CoreLocationCLI. After a full day's effort, I've identified an elegant solution: customizing the command line tool's Info.plist directly through the Package.swift configuration (while SwiftPM auto-generates this file, it currently lacks essential permission configuration options).

We've now validated a technical approach to add required permissions without creating .app bundles. Could you grant me 1-2 more days to finalize this implementation? Additionally, this Info.plist customization strategy may provide dual benefits for #30:

  • Resolving permission requirements
  • Enabling standard versioning through the CFBundleVersion field, consistent with other CLI tools that maintain explicit Info.plist configurations.

yclw added a commit to yclw/corelocationcli that referenced this pull request Apr 11, 2025
- Add required Info.plist with location permissions
- Configure linker sectcreate in Package.swift
- Remove temporary script workaround
- Closes fulldecent#50, fulldecent#51
- Contributes to fulldecent#30 (versioning support)
- Supersedes fulldecent#52
@fulldecent fulldecent merged commit 8649ac4 into fulldecent:main Apr 11, 2025
@fulldecent
Copy link
Owner

Thank you, this looks good.

Also maybe we can do a cask/application in Brew and then have a CLI inside that.

But hopefully this is all temporary anyway.

@yclw yclw deleted the fix-location-permissions branch April 12, 2025 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants