Check and Request Permissions in .NET MAUI

  Рет қаралды 25,120

James Montemagno

James Montemagno

Күн бұрын

Пікірлер: 64
@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. :/
@gtcollection6933
@gtcollection6933 2 жыл бұрын
James, thanks for this one. You saved the day. Let's go MAUI
@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
@mokanin8894
@mokanin8894 2 жыл бұрын
I wish I can code so easily like you one day.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
I believe in you!
@DeepWorksStudios
@DeepWorksStudios 2 жыл бұрын
Thanks for this valuable learn resource
@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....
@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)...
@marcoerlwein2165
@marcoerlwein2165 Жыл бұрын
Thank you !! good video !!! Query, are IOS permissions required to access Photos or is it explicit?
@leonardosamuelcervanteslaz1788
@leonardosamuelcervanteslaz1788 10 ай бұрын
Eres la Daga amigo!! muy buena explicacion
@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
@tranphuongnam2712
@tranphuongnam2712 2 жыл бұрын
Could we use Deeplink and Push notification for MAUI? Kindly please share this topic?
@caiocamargoantonio
@caiocamargoantonio Жыл бұрын
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????
@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?
@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!
@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.
@anandshindey
@anandshindey 2 жыл бұрын
Good Video, thanks. very helpful.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Glad it was helpful!
@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
@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
@srijan105
@srijan105 2 жыл бұрын
Could you please do shorts for storing application data option on WinUI3 ?
@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
@AdrianoPalmieri
@AdrianoPalmieri 2 жыл бұрын
Great video, very informative and well done 👍
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Thank you! 👍
@beelzaBob
@beelzaBob 6 ай бұрын
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 6 ай бұрын
For built in permissions they are documented which ones you need to add. Else android documentation outlines them
@beelzaBob
@beelzaBob 6 ай бұрын
@@JamesMontemagno Thanks! You explain it at the end of the video.
@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 .
@PatricSjoeoe
@PatricSjoeoe 2 жыл бұрын
Love your videos! =)
@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/
@usman8249
@usman8249 Ай бұрын
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 Ай бұрын
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
@mugileeshwaranj.s8484
@mugileeshwaranj.s8484 11 ай бұрын
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 11 ай бұрын
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 11 ай бұрын
Thanks!@@JamesMontemagno
@sabarinathg5704
@sabarinathg5704 11 ай бұрын
its interesting, however there is no permission item for notification, when both iOS & Android ensuring the developers to ask permission for notification.
@JamesMontemagno
@JamesMontemagno 11 ай бұрын
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 11 ай бұрын
​@@JamesMontemagno Thank you for responding. Make sense, why it is not implemented.
@wasimalam7677
@wasimalam7677 2 жыл бұрын
It is more helpful.
@sethisaacks8683
@sethisaacks8683 7 ай бұрын
For some reason, in .net 8.0, the override method for BasePlatformPermission no longer exists. Frustrating.
@JamesMontemagno
@JamesMontemagno 7 ай бұрын
It is still there github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.netstandard.cs
@sethisaacks8683
@sethisaacks8683 7 ай бұрын
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
@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
@huangjiawutw
@huangjiawutw 2 жыл бұрын
does anyone say your style like jesus 😅
Accessing Native Platform APIs in .NET MAUI
23:51
James Montemagno
Рет қаралды 18 М.
.NET MAUI Explained: What is it, How does it work, and What about Blazor?
34:28
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 35 МЛН
Каха и лужа  #непосредственнокаха
00:15
Take Pictures in Your App with CameraView for .NET MAUI
19:05
Gerald Versluis
Рет қаралды 7 М.
Use .NET MAUI FilePicker to Pick PDFs, Images, Videos and More!
15:24
Gerald Versluis
Рет қаралды 20 М.
What is the MVVM pattern, What benefits does MVVM have?
22:38
James Montemagno
Рет қаралды 100 М.
Is There Hope For .NET MAUI?
7:10
SingletonSean
Рет қаралды 30 М.
Starting .NET MAUI Development in 2024 - What You Need To Know
35:18
James Montemagno
Рет қаралды 76 М.
Highly Customizable Popups for .NET MAUI with Mopups
18:20
Gerald Versluis
Рет қаралды 32 М.
NativeAOT for .NET APIs Is Here and It’s INSANE!
14:07
Nick Chapsas
Рет қаралды 88 М.
Understand DotNet MAUI Layouts | DotNet MAUI Tutorial
27:13
Coding Droplets
Рет қаралды 26 М.
.NET MAUI's Navigation for Beginners - Push, Pop, & Pass Objects
21:36
James Montemagno
Рет қаралды 68 М.
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 35 МЛН