Check and Request Permissions in .NET MAUI

  Рет қаралды 26,340

James Montemagno

James Montemagno

Күн бұрын

Пікірлер: 67
@TimoKinnunen
@TimoKinnunen 2 жыл бұрын
Thank you for hard work! I asked for this kind of video and you made it so quickly. You are listening to us!
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
My pleasure!
@codemech99
@codemech99 2 жыл бұрын
Appreciate all of the great content around mobile development!
@ignispurgatorius5297
@ignispurgatorius5297 Жыл бұрын
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. :/
@beelzaBob
@beelzaBob 9 ай бұрын
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.
@JamesMontemagno
@JamesMontemagno 9 ай бұрын
For built in permissions they are documented which ones you need to add. Else android documentation outlines them
@beelzaBob
@beelzaBob 9 ай бұрын
@@JamesMontemagno Thanks! You explain it at the end of the video.
@gtcollection6933
@gtcollection6933 2 жыл бұрын
James, thanks for this one. You saved the day. Let's go MAUI
@keithsummers1889
@keithsummers1889 2 жыл бұрын
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.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Waiting for a few libraries to update, but will do. Tons of good samples out there though
@keithsummers1889
@keithsummers1889 2 жыл бұрын
@@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....
@JoanJim
@JoanJim 2 ай бұрын
Hello James, thank you for your contributions, they are very important to us. I have a question, how to enable GPS when the user has it disabled?
@JamesMontemagno
@JamesMontemagno 2 ай бұрын
You will have to prompt them to go turn it on and launch the settings screen. You can't do it for them
@valimaties5789
@valimaties5789 2 жыл бұрын
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)...
@DeepWorksStudios
@DeepWorksStudios 2 жыл бұрын
Thanks for this valuable learn resource
@mohamadrezamohamadi9915
@mohamadrezamohamadi9915 Жыл бұрын
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?
@raymondcruzin6213
@raymondcruzin6213 2 жыл бұрын
hi do you know how to make MAUI work to access (ble) bluetooth low energy on windows 10 machine?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Checkout Shiny lib or Plugin.BLE or access the windows apis directly
@srijan105
@srijan105 2 жыл бұрын
Could you please do shorts for storing application data option on WinUI3 ?
@leonardosamuelcervanteslaz1788
@leonardosamuelcervanteslaz1788 Жыл бұрын
Eres la Daga amigo!! muy buena explicacion
@tranphuongnam2712
@tranphuongnam2712 2 жыл бұрын
Could we use Deeplink and Push notification for MAUI? Kindly please share this topic?
@mokanin8894
@mokanin8894 2 жыл бұрын
I wish I can code so easily like you one day.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
I believe in you!
@sirflimflam
@sirflimflam Жыл бұрын
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.
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Check the docs. It is just the info.plist and each permission is documented
@yasminaamroun8682
@yasminaamroun8682 Жыл бұрын
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
@piotrw9486
@piotrw9486 2 жыл бұрын
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.
@mugileeshwaranj.s8484
@mugileeshwaranj.s8484 Жыл бұрын
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
@JamesMontemagno
@JamesMontemagno Жыл бұрын
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
@mugileeshwaranj.s8484
@mugileeshwaranj.s8484 Жыл бұрын
Thanks!@@JamesMontemagno
@marcoerlwein2165
@marcoerlwein2165 2 жыл бұрын
Thank you !! good video !!! Query, are IOS permissions required to access Photos or is it explicit?
@gamalzahra2361
@gamalzahra2361 Жыл бұрын
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!
@caiocamargoantonio
@caiocamargoantonio 2 жыл бұрын
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????
@anandshindey
@anandshindey 2 жыл бұрын
Good Video, thanks. very helpful.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Glad it was helpful!
@AdrianoPalmieri
@AdrianoPalmieri 2 жыл бұрын
Great video, very informative and well done 👍
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Thank you! 👍
@jasonyang696
@jasonyang696 Жыл бұрын
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.
@leanhkhoa6458
@leanhkhoa6458 Жыл бұрын
replace to Permissions.BasePlatformPermission
@leanhkhoa6458
@leanhkhoa6458 Жыл бұрын
replace to Permissions.BasePlatformPermission
@PatricSjoeoe
@PatricSjoeoe 2 жыл бұрын
Love your videos! =)
@st.5693
@st.5693 Жыл бұрын
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?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
You would call this code OnAppearing of your first page
@IriTaia
@IriTaia Жыл бұрын
how to catch if user is denied permission ?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
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.
@IriTaia
@IriTaia Жыл бұрын
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?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
I would need a code sample send it to me via email on my about page
@sethisaacks8683
@sethisaacks8683 10 ай бұрын
For some reason, in .net 8.0, the override method for BasePlatformPermission no longer exists. Frustrating.
@JamesMontemagno
@JamesMontemagno 10 ай бұрын
It is still there github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.netstandard.cs
@sethisaacks8683
@sethisaacks8683 10 ай бұрын
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
@hamadsalahud-din3617
@hamadsalahud-din3617 2 жыл бұрын
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 ?
@odnalroemosiaw746
@odnalroemosiaw746 2 жыл бұрын
Let me know when you solve that challenge.
@hamadsalahud-din3617
@hamadsalahud-din3617 2 жыл бұрын
@@odnalroemosiaw746 are you having the same issue?
@odnalroemosiaw746
@odnalroemosiaw746 2 жыл бұрын
@@hamadsalahud-din3617 yess i am
@hamadsalahud-din3617
@hamadsalahud-din3617 2 жыл бұрын
Well I m returning serialized claims as a part of authentication request if it's successful and locally store it in the cache
@ATNL4
@ATNL4 2 жыл бұрын
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 .
@usman8249
@usman8249 4 ай бұрын
Should we not use await Permissions.CheckStatusAsync() and await Permissions.RequestAsync() rather than using Custom permission? Should not this suffice all version problems? await Permissions.CheckStatusAsync() always returns granted for iOS(bug)
@JamesMontemagno
@JamesMontemagno 4 ай бұрын
So this is a new one that they added in so that one should be good now! I'll have to add a link into the description for this
@sabarinathg5704
@sabarinathg5704 Жыл бұрын
its interesting, however there is no permission item for notification, when both iOS & Android ensuring the developers to ask permission for notification.
@JamesMontemagno
@JamesMontemagno Жыл бұрын
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.
@sabarinathg5704
@sabarinathg5704 Жыл бұрын
​@@JamesMontemagno Thank you for responding. Make sense, why it is not implemented.
@douglaswt77
@douglaswt77 Ай бұрын
Shared
@akashkhan6013
@akashkhan6013 2 жыл бұрын
Running and debugging app in physical device would be great. we hope Microsoft will develop a solution soon.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
You can run on physical devices today. I do it all the time :) checkout the documentation: learn.microsoft.com/en-us/dotnet/maui/
@wasimalam7677
@wasimalam7677 2 жыл бұрын
It is more helpful.
@huangjiawutw
@huangjiawutw 2 жыл бұрын
does anyone say your style like jesus 😅
Accessing Native Platform APIs in .NET MAUI
23:51
James Montemagno
Рет қаралды 19 М.
.NET MAUI CardViews & Circle Images with Borders, Shapes, and Shadows
10:54
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Adding Fingerprint Or Face Recognition To Your .NET MAUI App
18:00
Gerald Versluis
Рет қаралды 10 М.
A quick look at Telerik controls for .NET MAUI
30:28
Javier Suárez
Рет қаралды 261
🐚 Shell for .NET MAUI & Xamarin.Forms - What, why, and how?!?!
16:51
James Montemagno
Рет қаралды 37 М.
What is the MVVM pattern, What benefits does MVVM have?
22:38
James Montemagno
Рет қаралды 104 М.
.NET MAUI Code & Control Sharing Strategies
10:56
James Montemagno
Рет қаралды 14 М.
.NET MAUI Explained: What is it, How does it work, and What about Blazor?
34:28
Use .NET MAUI FilePicker to Pick PDFs, Images, Videos and More!
15:24
Gerald Versluis
Рет қаралды 21 М.
Create a Signed and Publishable .NET MAUI Android App in VS2022
16:12
Gerald Versluis
Рет қаралды 41 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН