Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

Chapter 11 Getting Specific

Figure 11-2.  The application running on iOS (left) and macOS (right) showing the permission prompt when a weather widget is first added to a board

Windows

Windows applications have the concept of capabilities and it is up to developers to declare which capabilities are required in their applications. In order to do so for your application, you need to modify the

350

Chapter 11 Getting Specific

­Platforms/Windows/Package.appxmanifest file. Note that I am opting to edit the files inside Visual Studio Code as I find it provides a better editing experience. Add the following line inside the <Capabilities> element:

<DeviceCapability Name="location"/>

For further reference on how to get started with Geolocation refer to the Microsoft documentation at https://learn.microsoft.com/dotnet/ maui/platform-integration/device/geolocation?tabs=windows- get-started.

If you run the application on Windows now, you don’t see a permission request popup. Figure 11-3 shows the result of running the application on Windows.

Figure 11-3.  The application running on Windows showing the permission prompt when a weather widget is first added to a board

351