I recently updated the Nuget packages of an Xamarin.Forms application which accesses health and physical activity data in iOS and has been doing it successfully for a long time. One of the libraries to update was the third-party library responsible for taking the data from HealthKit and preparing it to be sent to the server.
After the update, I verified that the synchronization was still working, and we sent the application to the users. At first the application seemed to work correctly, but when it went into the background, the synchronization stopped. This behavior was rare since the update and documentation of the library did not indicate the need for any changes for this new version.
Upon retesting the app in the background, I found that it was failing with an insufficient permissions message. This happened because iOS, starting from version 15, needs a new entitlement to access health information in the background. After adding com.apple.developer.healthkit.background-delivery to the entitlements list, everything started working fine.
If you run into the same change, I hope this tip helps you fix it quickly, or avoid it all together.