Great video. I came here after seeing a Stack Exchange comment mentioning the video as a solution to adding custom permissions (specifically the BLE ones) not working on Android13/API33, but sadly it looks like it still doesn't fix the issues I'm having. Though at least I now know how the custom permission interface is supposed to work. Edit: Out of sheer desperation I tried to follow your code to the letter and discarded my partial class approach (which imho seems neater given the way MAUI organizes everything) and for some unholy reason it works now. I will leave this here in hopes that it helps some other poor sod struggling to connect to a bluetooth device. Rant: I was generally excited to see MAUI trying to advance Xamarin, but so far I've found that laughably basic stuff like basic Bluetooth support is still missing in it as well (continuing the shamefull xamarin tradition) and for the latest API level it seems to have a flat out plot stopper bug for my project. :/
Would love to see this done specifically for iOS. Every example I see for Maui seems to default to Android because it's easier to demonstrate the core concept. But there's so many edge cases and things you need to set up for iOS that this really only tells a small part of the process.
Why does a new technology that aims to simplify the development of cross-platform applications such as .Net MAUI require so much effort (specific codes to be added by users) to allow access to usage permissions on Android, IOS, MacCatalyst... etc.. Wouldn't it be more interesting for the IDE to have a screen to just request filling in the necessary permissions, making development much easier????
Hi James. Please, can you make a sample of app which contains a preload-data "SplashScreen" (a app-starting window which loads all needed data by the main application from eg. local files, images , etc, with a progressbar)...
Thanks for this nice hints which we need it 🙂, pls 🙏 we need 1 tut for compiling dotnet Maui for iOS platform from windows and able to publish the app on Apple store .
Hello, I want to have access to the message in Messenger and be able to read and use the message. There is no tutorial on the internet for maui that I can read the message sent through my application, such as the code to enter the program, and it will be read automatically in the application. There is a way?
Hi @JamesMontemagno, I tried your code, but compile error. "RequiredPermissions" can't be found in "BasePlatformPermission". Do you have any idea why? Thank you very much.
Hi James! The programmer must know what kind of permissions are required for his application so, we would be grateful if you could show us how an application will check and request automatically permissions at initialization, as usual, not by pressing a button. It is possible?
MAUI is great but there is one main problem - AppService and BackgroundTasks (I need this only on Windows for data synchronization). This is not possible with MAUI. I tried to do this like in UWP, but there is compatibility error. I tried Windows Service method, but there is permission problem - admin access. The only way to make it work is create second App with UWP and call it from MAUI app. This is very bad sollution. Do you know any other sollution for this problem? Many people are looking this in Internet.
Hello James; I did all the steps like you but I have this error, I don't know why it's RequestBluetooth() is always underlined in red. Can you help me please? Error CS0116 A namespace cannot directly contain members such as fields, methods or statements
At 7:30, you show how to deal with different permissions based on different Android versions by editing the AndroidManifest.xml file. How did you know which versions needed which permissions? I can't find that info.
It could be that newer versions of android have changed this and more aligned with iOS functionality so in my opinion, it would be best to see if the item was already denied, and if so, then pop up the dialogue to take them to the settings page
its interesting, however there is no permission item for notification, when both iOS & Android ensuring the developers to ask permission for notification.
Not every single permission is in there, but the majority of them are and then of course you can add custom permissions as well. Notifications are a bit tricky because they’re really really super custom for each platform.
Good day @james. I need one help regarding jwt token. I m returning jwt token from the .net6.0 API call when login from Maui app but the package that I add for decoding the jwt token gets complain about not being compatible with iOS and maccatalyst. Could you please help ?
Good question. On iOS you only get 1 attempt for the pop up, else you have to check and see if it is denied and open up the settings. On Android you are able to ask multiple times, but you can also check the rationale to see if they declined it previously.
Android. If user denied permission on request: locationStatus = await Permissions.RequestAsync(); if (locationStatus != PermissionStatus.Granted) the code on the next line is never executed. Suggestions?
Thank you for hard work! I asked for this kind of video and you made it so quickly. You are listening to us!
My pleasure!
Appreciate all of the great content around mobile development!
Great video. I came here after seeing a Stack Exchange comment mentioning the video as a solution to adding custom permissions (specifically the BLE ones) not working on Android13/API33, but sadly it looks like it still doesn't fix the issues I'm having. Though at least I now know how the custom permission interface is supposed to work. Edit: Out of sheer desperation I tried to follow your code to the letter and discarded my partial class approach (which imho seems neater given the way MAUI organizes everything) and for some unholy reason it works now. I will leave this here in hopes that it helps some other poor sod struggling to connect to a bluetooth device.
Rant: I was generally excited to see MAUI trying to advance Xamarin, but so far I've found that laughably basic stuff like basic Bluetooth support is still missing in it as well (continuing the shamefull xamarin tradition) and for the latest API level it seems to have a flat out plot stopper bug for my project. :/
James, thanks for this one. You saved the day. Let's go MAUI
Would love to see this done specifically for iOS. Every example I see for Maui seems to default to Android because it's easier to demonstrate the core concept. But there's so many edge cases and things you need to set up for iOS that this really only tells a small part of the process.
Check the docs. It is just the info.plist and each permission is documented
Thanks for this valuable learn resource
I wish I can code so easily like you one day.
I believe in you!
Why does a new technology that aims to simplify the development of cross-platform applications such as .Net MAUI require so much effort (specific codes to be added by users) to allow access to usage permissions on Android, IOS, MacCatalyst... etc..
Wouldn't it be more interesting for the IDE to have a screen to just request filling in the necessary permissions, making development much easier????
Eres la Daga amigo!! muy buena explicacion
Hi James. Please, can you make a sample of app which contains a preload-data "SplashScreen" (a app-starting window which loads all needed data by the main application from eg. local files, images , etc, with a progressbar)...
Good Video, thanks. very helpful.
Glad it was helpful!
Will you please do a full Bluetooth instructional video? I'm not a former Xamarin person, so setting up for native calls is new to me.
Waiting for a few libraries to update, but will do. Tons of good samples out there though
@@JamesMontemagno I have not seen MAUI based samples thus far. I wish I had a background in Xamarin to keep me on the right track....
Great video, very informative and well done 👍
Thank you! 👍
Thanks for this nice hints which we need it 🙂, pls 🙏 we need 1 tut for compiling dotnet Maui for iOS platform from windows and able to publish the app on Apple store .
Could we use Deeplink and Push notification for MAUI? Kindly please share this topic?
Could you please do shorts for storing application data option on WinUI3 ?
Hi James, read external storage permission doesn't work for android 13. Please make a video to explain how to access files in android 13!
Love your videos! =)
Hello, I want to have access to the message in Messenger and be able to read and use the message. There is no tutorial on the internet for maui that I can read the message sent through my application, such as the code to enter the program, and it will be read automatically in the application. There is a way?
Hi @JamesMontemagno,
I tried your code, but compile error.
"RequiredPermissions" can't be found in "BasePlatformPermission".
Do you have any idea why? Thank you very much.
replace to Permissions.BasePlatformPermission
replace to Permissions.BasePlatformPermission
Thank you !! good video !!! Query, are IOS permissions required to access Photos or is it explicit?
Hi James! The programmer must know what kind of permissions are required for his application so, we would be grateful if you could show us how an application will check and request automatically permissions at initialization, as usual, not by pressing a button. It is possible?
You would call this code OnAppearing of your first page
MAUI is great but there is one main problem - AppService and BackgroundTasks (I need this only on Windows for data synchronization). This is not possible with MAUI. I tried to do this like in UWP, but there is compatibility error. I tried Windows Service method, but there is permission problem - admin access. The only way to make it work is create second App with UWP and call it from MAUI app. This is very bad sollution. Do you know any other sollution for this problem? Many people are looking this in Internet.
hi do you know how to make MAUI work to access (ble) bluetooth low energy on windows 10 machine?
Checkout Shiny lib or Plugin.BLE or access the windows apis directly
Running and debugging app in physical device would be great. we hope Microsoft will develop a solution soon.
You can run on physical devices today. I do it all the time :) checkout the documentation: learn.microsoft.com/en-us/dotnet/maui/
Hello James; I did all the steps like you but I have this error, I don't know why it's RequestBluetooth() is always underlined in red. Can you help me please?
Error CS0116 A namespace cannot directly contain members such as fields, methods or statements
At 7:30, you show how to deal with different permissions based on different Android versions by editing the AndroidManifest.xml file. How did you know which versions needed which permissions? I can't find that info.
For built in permissions they are documented which ones you need to add. Else android documentation outlines them
@@JamesMontemagno Thanks! You explain it at the end of the video.
Hey, in Android, if i deny for two times, its not requesting again, it wants me to go directly to App, info page and request again
It could be that newer versions of android have changed this and more aligned with iOS functionality so in my opinion, it would be best to see if the item was already denied, and if so, then pop up the dialogue to take them to the settings page
Thanks!@@JamesMontemagno
its interesting, however there is no permission item for notification, when both iOS & Android ensuring the developers to ask permission for notification.
Not every single permission is in there, but the majority of them are and then of course you can add custom permissions as well. Notifications are a bit tricky because they’re really really super custom for each platform.
@@JamesMontemagno Thank you for responding. Make sense, why it is not implemented.
It is more helpful.
Good day @james. I need one help regarding jwt token.
I m returning jwt token from the .net6.0 API call when login from Maui app but the package that I add for decoding the jwt token gets complain about not being compatible with iOS and maccatalyst. Could you please help ?
Let me know when you solve that challenge.
@@odnalroemosiaw746 are you having the same issue?
@@hamadsalahud-din3617 yess i am
Well I m returning serialized claims as a part of authentication request if it's successful and locally store it in the cache
For some reason, in .net 8.0, the override method for BasePlatformPermission no longer exists. Frustrating.
It is still there github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.netstandard.cs
I missed the part in the video, where you changed the drop down at the top left of Visual Studio from Windows to Android @@JamesMontemagno
how to catch if user is denied permission ?
Good question. On iOS you only get 1 attempt for the pop up, else you have to check and see if it is denied and open up the settings. On Android you are able to ask multiple times, but you can also check the rationale to see if they declined it previously.
Android. If user denied permission on request:
locationStatus = await Permissions.RequestAsync();
if (locationStatus != PermissionStatus.Granted)
the code on the next line is never executed. Suggestions?
I would need a code sample send it to me via email on my about page
does anyone say your style like jesus 😅