liveBook · Manning

Permission

As explained in .NET MAUI in Action

A permission is an authorization that an operating system requires an application to obtain before accessing a protected capability or resource.

A permission is an authorization an operating system requires before an app accesses a protected capability or resource. Location access is privacy-sensitive: users must explicitly consent, and the app must check or request that consent at runtime. section 3.1 section 3.5

Permission handling has two parts. First, declare the capabilities the app may request in platform-specific metadata rather than ordinary application code. Second, use .NET MAUI methods to verify whether the user has consented and request permission when necessary. Android and iOS require declarations for requested permissions; each platform stores them in its own metadata file. section 3.1 section 3.5

For a .NET MAUI app that reads the user’s location:

  • Declare the location capability in the platform metadata. section 3.1
  • Check whether the user has already granted access. section 3.1
  • Request consent at runtime if access has not been granted. section 3.1
  • Only then access location through the common .NET MAUI geolocation API. section 3.1

Windows location capability

Open Platforms/Windows/Package.appxmanifest, find the Capabilities node, and add <DeviceCapability Name="location" />. This declares that the Windows app will ask for the user’s permission to access location. section 3.1.3

Figure 3.4 To access a user’s location, your app must request permission from the user. With .NET MAUI, you can check whether permission has been granted and request it from the user if not.

The permission flow checks whether location access has been granted and requests it from the user when necessary. section 3.1

How .NET MAUI in Action covers it

How deep it goes
Explains declaration, runtime checking, and consent requests, but does not detail each platform’s complete permission model.
Examples
Uses location access, the FindMe! app scenario, and a Windows Package.appxmanifest capability declaration.
What it assumes
Assumes basic .NET MAUI app structure and introduces platform metadata as the place for permission declarations.
What you can do after
Operate/configure a .NET MAUI app to declare location access and request or verify user consent at runtime.
How it connects
Connects permissions with .NET MAUI, geolocation API, runtime consent, and platform app metadata.

Also explained in

Compare how 4 books explain permission →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.