Skip to content
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

Fixed crashing on machines with early windows 10 version #1389

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions permission_handler_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.2.2
* Fixed crashing issue on early windows 10 machines (https://github.com/Baseflow/flutter-permission-handler/issues/1388)

## 0.2.1

* Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS and macOS).
Expand Down
2 changes: 1 addition & 1 deletion permission_handler_windows/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: permission_handler_windows
description: Permission plugin for Flutter. This plugin provides the Windows API to request and check permissions.
version: 0.2.1
version: 0.2.2
homepage: https://github.com/baseflow/flutter-permission-handler

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ void PermissionHandlerWindowsPlugin::RegisterWithRegistrar(
}

PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){
m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke,
[this](Geolocator const& geolocator, PositionChangedEventArgs e)
{
});
try {
m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke,
[this](Geolocator const& geolocator, PositionChangedEventArgs e)
{
});
} catch (...) {
/* Do nothing */
}
krll-kov marked this conversation as resolved.
Show resolved Hide resolved
}

PermissionHandlerWindowsPlugin::~PermissionHandlerWindowsPlugin() = default;
Expand Down Expand Up @@ -187,7 +191,11 @@ winrt::fire_and_forget PermissionHandlerWindowsPlugin::IsBluetoothServiceEnabled

void PermissionHandlerWindowsPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
PermissionHandlerWindowsPlugin::RegisterWithRegistrar(
try {
PermissionHandlerWindowsPlugin::RegisterWithRegistrar(
PluginRegistrarManager::GetInstance()
->GetRegistrar<PluginRegistrarWindows>(registrar));
} catch (...) {
/* Do nothing */
}
krll-kov marked this conversation as resolved.
Show resolved Hide resolved
}