Check and Request Permissions in .NET MAUI

Поделиться
HTML-код
  • Опубликовано: 20 авг 2024

Комментарии • 62

  • @TimoKinnunen
    @TimoKinnunen Год назад +9

    Thank you for hard work! I asked for this kind of video and you made it so quickly. You are listening to us!

  • @codemech99
    @codemech99 Год назад +3

    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 Год назад

    James, thanks for this one. You saved the day. Let's go MAUI

  • @sirflimflam
    @sirflimflam Год назад +2

    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

  • @DeepWorksStudios
    @DeepWorksStudios Год назад +1

    Thanks for this valuable learn resource

  • @mokanin8894
    @mokanin8894 Год назад +1

    I wish I can code so easily like you one day.

  • @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????

  • @leonardosamuelcervanteslaz1788
    @leonardosamuelcervanteslaz1788 7 месяцев назад

    Eres la Daga amigo!! muy buena explicacion

  • @valimaties5789
    @valimaties5789 Год назад +1

    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)...

  • @anandshindey
    @anandshindey Год назад +1

    Good Video, thanks. very helpful.

  • @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  Год назад

      Waiting for a few libraries to update, but will do. Tons of good samples out there though

    • @keithsummers1889
      @keithsummers1889 Год назад

      @@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....

  • @AdrianoPalmieri
    @AdrianoPalmieri Год назад

    Great video, very informative and well done 👍

  • @ATNL4
    @ATNL4 Год назад

    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 .

  • @tranphuongnam2712
    @tranphuongnam2712 Год назад

    Could we use Deeplink and Push notification for MAUI? Kindly please share this topic?

  • @srijan105
    @srijan105 Год назад

    Could you please do shorts for storing application data option on WinUI3 ?

  • @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!

  • @PatricSjoeoe
    @PatricSjoeoe Год назад

    Love your videos! =)

  • @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?

  • @jasonyang696
    @jasonyang696 Год назад +2

    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 10 месяцев назад

      replace to Permissions.BasePlatformPermission

    • @leanhkhoa6458
      @leanhkhoa6458 10 месяцев назад

      replace to Permissions.BasePlatformPermission

  • @marcoerlwein2165
    @marcoerlwein2165 Год назад

    Thank you !! good video !!! Query, are IOS permissions required to access Photos or is it explicit?

  • @st.5693
    @st.5693 Год назад +1

    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  Год назад +2

      You would call this code OnAppearing of your first page

  • @piotrw9486
    @piotrw9486 Год назад

    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.

  • @raymondcruzin6213
    @raymondcruzin6213 Год назад +1

    hi do you know how to make MAUI work to access (ble) bluetooth low energy on windows 10 machine?

    • @JamesMontemagno
      @JamesMontemagno  Год назад

      Checkout Shiny lib or Plugin.BLE or access the windows apis directly

  • @akashkhan6013
    @akashkhan6013 Год назад

    Running and debugging app in physical device would be great. we hope Microsoft will develop a solution soon.

    • @JamesMontemagno
      @JamesMontemagno  Год назад

      You can run on physical devices today. I do it all the time :) checkout the documentation: learn.microsoft.com/en-us/dotnet/maui/

  • @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

  • @beelzaBob
    @beelzaBob 4 месяца назад

    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  4 месяца назад +1

      For built in permissions they are documented which ones you need to add. Else android documentation outlines them

    • @beelzaBob
      @beelzaBob 4 месяца назад

      @@JamesMontemagno Thanks! You explain it at the end of the video.

  • @mugileeshwaranj.s8484
    @mugileeshwaranj.s8484 8 месяцев назад

    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  8 месяцев назад

      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 8 месяцев назад

      Thanks!@@JamesMontemagno

  • @sabarinathg5704
    @sabarinathg5704 8 месяцев назад

    its interesting, however there is no permission item for notification, when both iOS & Android ensuring the developers to ask permission for notification.

    • @JamesMontemagno
      @JamesMontemagno  8 месяцев назад

      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 8 месяцев назад

      ​@@JamesMontemagno Thank you for responding. Make sense, why it is not implemented.

  • @wasimalam7677
    @wasimalam7677 Год назад +1

    It is more helpful.

  • @hamadsalahud-din3617
    @hamadsalahud-din3617 Год назад +1

    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 Год назад

      Let me know when you solve that challenge.

    • @hamadsalahud-din3617
      @hamadsalahud-din3617 Год назад

      @@odnalroemosiaw746 are you having the same issue?

    • @odnalroemosiaw746
      @odnalroemosiaw746 Год назад

      @@hamadsalahud-din3617 yess i am

    • @hamadsalahud-din3617
      @hamadsalahud-din3617 Год назад

      Well I m returning serialized claims as a part of authentication request if it's successful and locally store it in the cache

  • @sethisaacks8683
    @sethisaacks8683 4 месяца назад

    For some reason, in .net 8.0, the override method for BasePlatformPermission no longer exists. Frustrating.

    • @JamesMontemagno
      @JamesMontemagno  4 месяца назад

      It is still there github.com/dotnet/maui/blob/main/src/Essentials/src/Permissions/Permissions.netstandard.cs

    • @sethisaacks8683
      @sethisaacks8683 4 месяца назад

      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

  • @IrinaTaiakina
    @IrinaTaiakina Год назад

    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.

    • @IrinaTaiakina
      @IrinaTaiakina Год назад

      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 Год назад +1

    does anyone say your style like jesus 😅