Disabling Map Zoom Controls and Other Buttons in .NET MAUI Android

In this post, we’ll guide you through the process of disabling these UI elements (zoom controls, compass, and location buttons) in your Android map implementation using a custom map handler. This approach gives you more control over the user experience and map functionality in your mobile app. Creating a Custom Map Handler To disable these controls, we need to customize how the map is rendered on Android. This involves creating a custom map handler that intercepts the way the map is displayed and adjusts its settings. A detailed tutorial for creating custom map handlers can be found in this great guide by Vladislav Antonyuk. We will extend that concept here. First, we need to implement a MapCallbackHandler that disables specific controls when the map is ready. This is done in the OnMapReady method, which is triggered when the map is fully loaded and ready for interaction. In the OnMapReady method, we access the googleMap.UiSettings property, which contains several settings that control the map’s UI. In our example, we set the following to false: You can also adjust other settings here, such as disabling tilt gestures or zoom gestures if needed.

Using Different Entitlements for Debug and Release Modes in .NET MAUI – iOS

When developing a mobile app using .NET MAUI, particularly for iOS, it’s essential to configure your application differently for debug and release modes. One of these differences is the APS-environment setting, which dictates how your app communicates with Apple Push Notification services (APNs) during development and production. What is Entitlements.plist? The Entitlements.plist is a property list (plist) file that defines various capabilities or entitlements for your app. Entitlements are special permissions that allow your app to use certain services provided by iOS, such as iCloud, In-App Purchases, or push notifications. For push notifications, the Entitlements.plist file contains the APS-environment key, which indicates to Apple whether your app is in development or production mode. Based on this, the app uses either the sandbox or production APNs. What is APS-environment? The APS-environment (Apple Push Services environment) is an entitlement used to specify the environment for push notifications. This entitlement informs Apple’s servers whether the app is running in a development environment or in production, determining which server to send the notifications through: This configuration helps separate testing from live user interactions and avoids accidental notification delivery to users during testing. Configuring Different APS-environments for Debug and Release To configure different environments for Debug and Release modes in your .NET MAUI project, you can modify your .csproj file as follows: It’s important to ensure that both Entitlements.plist and Entitlements-Production.plist files are not included in the build by accident. This can be achieved by setting their Build Action to None: This step ensures that the files are correctly associated with your app for code-signing purposes but are not compiled into the app bundle…

Azure Pipelines error after macOS / iOS update when building iOS apps with .NET MAUI

If you are facing problems after a new version of macOS, or iOS have been released, stay tuned. In this example, I’m having issues with the new update of iOS 18 and macOS Sequioa. Some days or weeks are needed from Microsoft side to have a vmPool in the cloud to build your iOS apps with the latest SDKs, so theres a possibility that you might encounter this problem on some fresher updates aswell. So how the error looks like? Solution after the proper vmImages are released by Microsoft: To resolve this issue, you need to update the macOS image used in your Azure Pipelines to the latest version. This ensures that the build environment uses the most recent version of Xcode, which includes the necessary iOS SDKs. Here’s how you can update your Azure Pipelines configuration: By updating the vmImage to macOS-latest, you ensure that your build environment is using the latest tools and SDKs, which should resolve the linker errors related to unavailable types. Solution until the proper vmImages are not present: Modify your pipeline, and don’t forget to add comments on the modified pipeline!

.NET MAUI Android: OverrideBackButtonPress not being hit.

You might encounter a scenario where the OverrideBackButtonPress method in your Page is not being triggered on Android devices. This can be a frustrating issue, but there’s a straightforward solution that involves modifying your AndroidManifest.xml file. The predictive back gesture feature in Android can indeed affect how back button presses are handled in your application. Learn more at: https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture Predictive Back Gesture Android’s predictive back gesture allows users to preview the destination or action that will occur when they complete a back gesture. In .NET MAUI, the OverrideBackButtonPress method allows you to handle the back button press event in your application. However, if this method is not being called, it could be due to a specific setting in your AndroidManifest.xml file. Disabling Predictive Back Gesture To ensure your custom back button handling works as expected, you need to disable the predictive back gesture by setting the android:enableOnBackInvokedCallback attribute to false in your AndroidManifest.xml file. This prevents the system from intercepting the back button press and allows your application to handle it.

Visual Studio for Mac: The target platform identifier was not recognized .NET MAUI

If you are facing issues on macOS, with the retiring Visual Studio for Mac launching your .NET MAUI app, or restoring the packages on it: This error can be also recognized from this toolbar: Ensure whether you have the correct .NET Workloads installed with the terminal command: Check whether you have the latest .NET SDK installed on your machine, from the Microsoft’s official website. Ensure you have enabled “Use the .NET 8 SDK if installed” in the Visual Studio for Mac’s preferences.