Flutter Permission : Managing App Permissions in iOS device | permission in iOS app | amplifyabhi

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this blog we will try to see the implementation  of permission handling in iOS based flutter   application so in our previous tutorial we have  seen permission handling in Android based flutter   application and in this part of the tutorial  will be mainly concentrating on how to get the   permissions in iOS based app so now the very  first thing I would like to share here is like   this is a continuation of our previous tutorial  and the code for this particular tutorial I am   providing in the description section below and  also I suggest you to watch the previous tutorial   before getting started with this particular  tutorial because I have made use of the same   code and also you can just get the detailed  explanation of the code in our previous tutorial   so now let's get started  with this particular tutorial [Music] so the very first step is we need to add  the dependency here in pubspec file here   so that is permission Handler and now come back  to our code here and under iOS directory here   you will be having pod file so now you need  to specify the permissions which you require   in the application so here for sample tutorial  purpose I have specified few permissions over   here and I would like to show you one or two  permissions here in this part of tutorial so   these are the permissions which we use almost  in every application like contacts camera   microphone calendar and that depending upon your  requirement so now I am going to show you with a   location permission because it's important  nowadays like every application might have   the location requirement in their app to serve  the user based on this location so now let's go   back to our code here in main.dot file and here I  have specified permission as location now so you   are having a lot of options here like camera  calendar photos all these things but just for   example purpose I am showing you location here and  in our previous tutorial how to fetch the location   permission in Android device I have explained  so in this part of the tutorial same location   permission in iOS device I am going to explain  now so in the Pod file whenever you specify these   particular permissions here so the very first  thing so after adding all these permissions in   the Pod file the very first thing you need to  do is like right click on the iOS folder and   open in terminal and now let's try to install  pod here so after adding all these permissions   you need to run this particular command like pod  installed so I have already done this particular   step here and whenever you're trying to implement  this particular tutorial make sure you perform   this particular step or else you will not get  the proper output and now go back to info.plist   file so inside the pods so inside the runner  folder here you are having info.plist file so   info.plist and pod file are the important files  whenever you are dealing with the iOS application   with the help of flutter so now here we are  going to add the location permission so even   in info.plist file we need to specify the location  permission details here or else it will not work   when you only specify import file so make sure  you specify the required things in both the Pod   file and info.plist file and if at all you are  having any queries just let me know in the comment   section below or else you want to implement any  other permission just let me know in the comment   section below I will surely try to help you so now  we have added in the both the places like pod file   and info dot PLS file and in the main dot dot also  we have specified permission dot location here   and it's time to run our application and check  whether this works or not so I have opened my   iOS phone simulator and try to run this particular  code and if you are a beginner it might be very   much difficult for you to seek permission in iOS  application but once you follow this particular   tutorial it will be very easy for you in handling  the permissions both in Android and iOS device and   also the code for this tutorial I am providing  in the description section below just try to   go through it if you are having any queries  in the implementation so now our code is now   up and running and now let's try to tap on check  permission button here and here you can see we are   able to see like location permission on our device  so it is asking us to allow and here flutter   Basics is our application name and it is saying  like allow flutter Basics to use your location and   again it's your requirement you can just tap on  Allo ones or allo while using this app so in this   way here you can see permission is granted I have  made use of a snack bar here in showing up like   permission is granted and if you have not allowed  then you will be going to the else block of code   and there you can go according to your requirement  as if you want to ask the user one more time or   you just go or you just stop the user from using  your application because the permission was not   granted so all these things you can execute in the  else block of code and now let us try to see one   more permission handling just as for a tutorial  purpose so here we have like photo library so I   have added the photo library permission as well  so now let's go back here and instead of location   now let's try to specify photos here and now try  to rename this particular code and here you can   see the application is restarted and when you tap  on check permission here this time you are seeing   like flutter Basics would like to access your  photos and once you tap on select photos here you   can open the gallery here so here my gallery has  been opened in my simulator and you can select any   one of the image and tap on so in this way we'll  implement the permission Handler in iOS devices   as well so I hope this is very clear for you to  understand and once again I like to suggest you   to go through these two tutorials on permission  Handler in flutter application and the code for   this tutorial is provided in the description  section below if you are having any queries just   let me know in the comment section below and this  is it for this particular tutorial if you like   this tutorial do like share and subscribe to our  channel for more interesting content on flutter
Info
Channel: amplifyabhi coding
Views: 5,432
Rating: undefined out of 5
Keywords:
Id: Nx3BYN8slg8
Channel Id: undefined
Length: 6min 50sec (410 seconds)
Published: Thu Jun 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.