Skip to content

fix(windows): handle openAppSettings instead of every other method - #1570

Open
Seungpyo1007 wants to merge 1 commit into
Baseflow:mainfrom
Seungpyo1007:fix/windows-open-app-settings
Open

Seungpyo1007 wants to merge 1 commit into
Baseflow:mainfrom
Seungpyo1007:fix/windows-open-app-settings

Conversation

@Seungpyo1007

Copy link
Copy Markdown

Closes #1564

HandleMethodCall in the Windows plugin checks methodName.compare("openAppSettings") without == 0. compare returns 0 on a match, so the condition is false for openAppSettings and true for every other method name.

As a result, openAppSettings() on Windows hits NotImplemented and throws a MissingPluginException on the Dart side. Unknown method names, meanwhile, get false instead of NotImplemented.

The fix adds the missing == 0, bumps permission_handler_windows to 0.2.3, and adds a CHANGELOG entry.

The only method names the method channel sends are checkPermissionStatus, checkServiceStatus, requestPermissions, shouldShowRequestPermissionRationale and openAppSettings, and the Windows plugin handles all five. So returning NotImplemented for anything else doesn't break an existing call. openAppSettings now returns false, the same as shouldShowRequestPermissionRationale.

Pre-launch Checklist

  • I made sure the project builds. (I'm on macOS and couldn't build the Windows plugin; the change is a single comparison)
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///). (not applicable)
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests. (there are no native tests for the Windows plugin)
  • I made sure all existing and new tests are passing. (no Dart code changed)
  • I ran dart format . and committed any changes. (no Dart code changed)
  • I ran flutter analyze and fixed any errors. (no Dart code changed)

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.

[Bug]: Missing == 0 inverts the openAppSettings check in permission_handler_windows_plugin.cpp

1 participant