├── .editorconfig ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── art └── icon.png ├── nuget └── readme.txt ├── samples ├── PermissionsSample.sln └── PermissionsSample │ ├── PermissionsSample.Droid │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── PermissionsSample.Droid.csproj │ ├── PermissionsSample.Droid.csproj.bak │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ └── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.Designer.cs │ │ ├── drawable-hdpi │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ └── icon.png │ │ ├── drawable │ │ └── icon.png │ │ ├── layout │ │ └── toolbar.axml │ │ ├── values-v21 │ │ └── style.xml │ │ └── values │ │ ├── colors.xml │ │ └── style.xml │ ├── PermissionsSample.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── PermissionsSample.UWP.csproj │ └── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── PermissionsSample.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── PermissionsSample.iOS.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── iTunesArtwork │ └── iTunesArtwork@2x │ └── PermissionsSample │ ├── App.cs │ ├── GeolocationPage.xaml │ ├── GeolocationPage.xaml.cs │ ├── PermissionsSample.csproj │ └── Utils.cs └── src ├── Permissions.sln ├── PermissionsTest.Droid ├── Assets │ └── AboutAssets.txt ├── MainActivity.cs ├── PermissionsTest.Droid.csproj ├── PermissionsTest.Droid.csproj.bak ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs └── Resources │ ├── AboutResources.txt │ ├── Resource.Designer.cs │ ├── drawable-hdpi │ └── icon.png │ ├── drawable-xhdpi │ └── icon.png │ ├── drawable-xxhdpi │ └── icon.png │ ├── drawable │ └── icon.png │ ├── layout │ └── toolbar.axml │ ├── values-v21 │ └── style.xml │ └── values │ ├── colors.xml │ └── style.xml ├── PermissionsTest.iOS ├── AppDelegate.cs ├── Entitlements.plist ├── Info.plist ├── Main.cs ├── PermissionsTest.iOS.csproj ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Default-568h@2x.png │ ├── Default-Portrait.png │ ├── Default-Portrait@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Icon-60@2x.png │ ├── Icon-60@3x.png │ ├── Icon-76.png │ ├── Icon-76@2x.png │ ├── Icon-Small-40.png │ ├── Icon-Small-40@2x.png │ ├── Icon-Small-40@3x.png │ ├── Icon-Small.png │ ├── Icon-Small@2x.png │ └── Icon-Small@3x.png ├── iTunesArtwork └── iTunesArtwork@2x ├── PermissionsTest ├── App.cs ├── GeolocationPage.xaml ├── GeolocationPage.xaml.cs └── PermissionsTest.csproj └── Plugin.Permissions ├── CrossPermissions.shared.cs ├── IPermissions.shared.cs ├── PermissionEnums.shared.cs ├── PermissionImplementations.shared.cs ├── Permissions.android.cs ├── Permissions.apple.cs ├── Permissions.uwp.cs └── Plugin.Permissions.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | # Suppress: EC112 2 | # top-most EditorConfig file 3 | root = true 4 | 5 | # Don't use tabs for indentation. 6 | [*] 7 | indent_style = tab 8 | # (Please don't specify an indent_size here; that has too many unintended consequences.) 9 | 10 | # Code files 11 | [*.{cs,csx,vb,vbx}] 12 | indent_size = 4 13 | 14 | # Xml project files 15 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] 16 | indent_size = 2 17 | 18 | # Xml config files 19 | [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] 20 | indent_size = 2 21 | 22 | # JSON files 23 | [*.json] 24 | indent_size = 2 25 | 26 | # Dotnet code style settings: 27 | [*.{cs,vb}] 28 | # Sort using and Import directives with System.* appearing first 29 | dotnet_sort_system_directives_first = false 30 | # Avoid "this." and "Me." if not necessary 31 | dotnet_style_qualification_for_field = false:suggestion 32 | dotnet_style_qualification_for_property = false:suggestion 33 | dotnet_style_qualification_for_method = false:suggestion 34 | dotnet_style_qualification_for_event = false:suggestion 35 | 36 | # Use language keywords instead of framework type names for type references 37 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion 38 | dotnet_style_predefined_type_for_member_access = true:suggestion 39 | 40 | # Suggest more modern language features when available 41 | dotnet_style_object_initializer = true:suggestion 42 | dotnet_style_collection_initializer = true:suggestion 43 | dotnet_style_coalesce_expression = true:suggestion 44 | dotnet_style_null_propagation = true:suggestion 45 | dotnet_style_explicit_tuple_names = true:suggestion 46 | 47 | # Naming Conventions: 48 | # Pascal Casing 49 | dotnet_naming_symbols.method_and_property_symbols.applicable_kinds= method,property,enum 50 | dotnet_naming_symbols.method_and_property_symbols.applicable_accessibilities = * 51 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case 52 | 53 | dotnet_naming_rule.methods_and_properties_must_be_pascal_case.severity = warning 54 | dotnet_naming_rule.methods_and_properties_must_be_pascal_case.symbols = method_and_property_symbols 55 | dotnet_naming_rule.methods_and_properties_must_be_pascal_case.style = pascal_case_style 56 | 57 | # Non-public members must be lower-case 58 | dotnet_naming_symbols.non_public_symbols.applicable_kinds = property,method,field,event,delegate 59 | dotnet_naming_symbols.non_public_symbols.applicable_accessibilities = private 60 | dotnet_naming_style.all_lower_case_style.capitalization = camel_case 61 | 62 | dotnet_naming_rule.non_public_members_must_be_lower_case.severity = warning 63 | dotnet_naming_rule.non_public_members_must_be_lower_case.symbols = non_public_symbols 64 | dotnet_naming_rule.non_public_members_must_be_lower_case.style = all_lower_case_style 65 | 66 | # CSharp code style settings: 67 | [*.cs] 68 | # Do not prefer "var" everywhere 69 | csharp_style_var_for_built_in_types = true:suggestion 70 | csharp_style_var_when_type_is_apparent = true:suggestion 71 | csharp_style_var_elsewhere = true:suggestion 72 | 73 | # Prefer method-like constructs to have a block body 74 | csharp_style_expression_bodied_methods = true:suggestion 75 | csharp_style_expression_bodied_constructors = true:none 76 | csharp_style_expression_bodied_operators = true:none 77 | 78 | # Prefer property-like constructs to have an expression-body 79 | csharp_style_expression_bodied_properties = true:suggestion 80 | csharp_style_expression_bodied_indexers = true:none 81 | csharp_style_expression_bodied_accessors = true:none 82 | 83 | # Suggest more modern language features when available 84 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 85 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 86 | csharp_style_inlined_variable_declaration = true:suggestion 87 | csharp_style_throw_expression = true:suggestion 88 | csharp_style_conditional_delegate_call = true:suggestion 89 | 90 | # Newline settings 91 | csharp_new_line_before_open_brace = all 92 | csharp_new_line_before_else = true 93 | csharp_new_line_before_catch = true 94 | csharp_new_line_before_finally = true 95 | csharp_new_line_before_members_in_object_initializers = true 96 | csharp_new_line_before_members_in_anonymous_types = true 97 | 98 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: jamesmontemagno 2 | patreon: mergeconflictfm 3 | custom: https://www.buymeacoffee.com/jamesmontemagno 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below. 2 | 3 | **Failure to fill out this information will result in this issue being closed.** If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here. 4 | 5 | ## Bug Information 6 | 7 | Version Number of Plugin: 8 | Device Tested On: 9 | Simulator Tested On: 10 | Version of VS: 11 | Version of Xamarin: 12 | Versions of other things you are using: 13 | 14 | ### Steps to reproduce the Behavior 15 | 16 | ### Expected Behavior 17 | 18 | ### Actual Behavior 19 | 20 | ### Code snippet 21 | 22 | ### Screenshots 23 | 24 | 25 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please take a moment to fill out the following: 2 | 3 | Fixes # . 4 | 5 | Changes Proposed in this pull request: 6 | - 7 | - 8 | - 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | 24 | # Visual Studio 2015 cache/options directory 25 | .vs/ 26 | # Uncomment if you have tasks that create the project's static files in wwwroot 27 | #wwwroot/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | # DNX 43 | project.lock.json 44 | artifacts/ 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opendb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | # NuGet v3's project.json files produces more ignoreable files 154 | *.nuget.props 155 | *.nuget.targets 156 | 157 | # Microsoft Azure Build Output 158 | csx/ 159 | *.build.csdef 160 | 161 | # Microsoft Azure Emulator 162 | ecf/ 163 | rcf/ 164 | 165 | # Microsoft Azure ApplicationInsights config file 166 | ApplicationInsights.config 167 | 168 | # Windows Store app package directory 169 | AppPackages/ 170 | BundleArtifacts/ 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # RIA/Silverlight projects 190 | Generated_Code/ 191 | 192 | # Backup & report files from converting an old project file 193 | # to a newer Visual Studio version. Backup files are not needed, 194 | # because we have git ;-) 195 | _UpgradeReport_Files/ 196 | Backup*/ 197 | UpgradeLog*.XML 198 | UpgradeLog*.htm 199 | 200 | # SQL Server files 201 | *.mdf 202 | *.ldf 203 | 204 | # Business Intelligence projects 205 | *.rdl.data 206 | *.bim.layout 207 | *.bim_*.settings 208 | 209 | # Microsoft Fakes 210 | FakesAssemblies/ 211 | 212 | # GhostDoc plugin setting file 213 | *.GhostDoc.xml 214 | 215 | # Node.js Tools for Visual Studio 216 | .ntvs_analysis.dat 217 | 218 | # Visual Studio 6 build log 219 | *.plg 220 | 221 | # Visual Studio 6 workspace options file 222 | *.opt 223 | 224 | # Visual Studio LightSwitch build output 225 | **/*.HTMLClient/GeneratedArtifacts 226 | **/*.DesktopClient/GeneratedArtifacts 227 | **/*.DesktopClient/ModelManifest.xml 228 | **/*.Server/GeneratedArtifacts 229 | **/*.Server/ModelManifest.xml 230 | _Pvt_Extensions 231 | 232 | # Paket dependency manager 233 | .paket/paket.exe 234 | 235 | # FAKE - F# Make 236 | .fake/ 237 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ### 3.0.0 3 | * Upgrade to CurrentActivity 2.0 4 | * iOS cleanup issues with sensor (better support for ios 11) 5 | 6 | 7 | ### 2.2.0 8 | * Android: Fix edgecase when permission is inserted twice into returned dictionary 9 | * Andriod: If setting target < M will return proper permissions when checked. 10 | 11 | ### 2.1.0 12 | * Add MediaLibrary permission for iOS's MPMediaLibrary 13 | * Add LocationAlways & LocationWhenInUse permissions for iOS to directly ask 14 | * Fix some issues with locking on iOS 15 | 16 | ### 2.0.0 17 | * Re-target .NET Standard 18 | * Dependent on Android 25.3.1 Support Libraries 19 | 20 | ### 1.2.0 21 | * Add microphone permission 22 | * Initial UWP permissions 23 | * Use 23.3.0 Android Support Library 24 | 25 | ### 1.1.7 26 | * Fix issue for Windows Config 27 | 28 | ### 1.1.6 29 | * Fix for checking photos permission on iOS #192 30 | 31 | ### 1.1.5 32 | * Fix odd instance where can't check manifest because current activity is null, now use application context. 33 | * If Activity is null when requesting then go ahead and return list of unknown permissions 34 | 35 | ### 1.1.4 36 | * Fix for #169, odd freeze for certain iOS permissions when requesting a second time in a denied state. 37 | 38 | ### 1.1.3 39 | * Remove help file, but add readme.txt 40 | 41 | ### 1.1.1 42 | * Fix odd edgecase in Android for nothing in Manifest. 43 | * Use Context instead of Activity when checking permisson if we can. 44 | * Change to params of permissions when requesting permissions. 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 James Montemagno 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Permissions Plugin for Xamarin 2 | 3 | Simple cross platform plugin to request and check permissions. 4 | 5 | Want to read about the creation, checkout my [in-depth blog post](http://motzcod.es/post/133939517717/simplified-ios-android-runtime-permissions-with). 6 | 7 | ### Migrate to: [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/index?WT.mc_id=friends-0000-jamont) or [.NET MAUI](https://learn.microsoft.com/dotnet/maui/platform-integration/appmodel/permissions?WT.mc_id=friends-0000-jamont) 8 | 9 | I have been working on Plugins for Xamarin for a long time now. Through the years I have always wanted to create a single, optimized, and official package from the Xamarin team at Microsoft that could easily be consumed by any application. The time is now with [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/index?WT.mc_id=friends-0000-jamont), which offers over 50 cross-platform native APIs in a single optimized package. I worked on this new library with an amazing team of developers and I highly highly highly recommend you check it out. 10 | 11 | Additionally, Xamarin.Essentials is now included in & [.NET MAUI](https://learn.microsoft.com/dotnet/maui/platform-integration/appmodel/permissions?WT.mc_id=friends-0000-jamont). 12 | 13 | Due to the functionality being included "in the box" I have decided to officially archive this repo. 14 | 15 | 16 | 17 | ### Setup 18 | * Available on NuGet: http://www.nuget.org/packages/Plugin.Permissions [![NuGet](https://img.shields.io/nuget/v/Plugin.Permissions.svg?label=NuGet)](https://www.nuget.org/packages/Plugin.Permissions/) 19 | * Install into your PCL/.NET Standard project and Client projects. 20 | * Development NuGet: https://www.myget.org/feed/Packages/xamarin-plugins 21 | 22 | **Platform Support** 23 | 24 | |Platform|Version| 25 | | ------------------- | :-----------: | 26 | |Xamarin.iOS|iOS 8+| 27 | |Xamarin.Android|API 14+| 28 | |Windows 10 UWP(Beta)|10+| 29 | 30 | *See platform notes below 31 | 32 | Build Status: ![Build status](https://jamesmontemagno.visualstudio.com/_apis/public/build/definitions/6b79a378-ddd6-4e31-98ac-a12fcd68644c/19/badge) 33 | 34 | ### Android specific in your BaseActivity or MainActivity (for Xamarin.Forms) add this code: 35 | ```csharp 36 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) 37 | { 38 | PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); 39 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 40 | } 41 | ``` 42 | 43 | ## Android Setup 44 | 45 | This plugin uses the [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/?WT.mc_id=friends-0000-jamont), please follow the setup guide. 46 | 47 | ```csharp 48 | Xamarin.Essentials.Platform.Init(this, bundle); 49 | ``` 50 | 51 | ### iOS Specific 52 | Based on what permissions you are using, you must add information into your info.plist. Please read the [Working with Security and Privacy guide for keys you will need to add](https://developer.xamarin.com/guides/ios/application_fundamentals/security-privacy-enhancements/). 53 | 54 | 55 | ### API Usage 56 | 57 | You are able to check and requests permissions with just a few lines of code: 58 | 59 | Check permission: 60 | 61 | ```csharp 62 | PermissionStatus status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 63 | ``` 64 | 65 | Request permission: 66 | ```csharp 67 | PermissionStatus status = await CrossPermissions.Current.RequestPermissionAsync(); 68 | ``` 69 | 70 | Additionally on Android there is a situation where you may want to detect if the user has already declined the permission and you should show your own pop up: 71 | 72 | ```csharp 73 | bool shouldShow = await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Calendar); 74 | ``` 75 | 76 | #### Available Permissions 77 | 78 | * CalendarPermission 79 | * CameraPermission 80 | * ContactsPermission 81 | * LocationPermission 82 | * LocationAlwaysPermission 83 | * LocationWhenInUsePermission 84 | * MediaLibraryPermission 85 | * MicrophonePermission 86 | * PhonePermission 87 | * PhotosPermission 88 | * RemindersPermission 89 | * SensorsPermission 90 | * SmsPermission 91 | * StoragePermission 92 | * SpeechPermission 93 | 94 | 95 | ### In Action 96 | Here is how you may use it with geolocation: 97 | 98 | ```csharp 99 | try 100 | { 101 | var status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 102 | if (status != PermissionStatus.Granted) 103 | { 104 | if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Location)) 105 | { 106 | await DisplayAlert("Need location", "Gunna need that location", "OK"); 107 | } 108 | 109 | status = await CrossPermissions.Current.RequestPermissionAsync(); 110 | } 111 | 112 | if (status == PermissionStatus.Granted) 113 | { 114 | //Query permission 115 | } 116 | else if (status != PermissionStatus.Unknown) 117 | { 118 | //location denied 119 | } 120 | } 121 | catch (Exception ex) 122 | { 123 | //Something went wrong 124 | } 125 | ``` 126 | 127 | 128 | 129 | 130 | Read more about android permissions: http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous 131 | 132 | 133 | ### IMPORTANT 134 | #### Android: 135 | 136 | You still need to request the permissions in your AndroidManifest.xml. Also ensure your MainApplication.cs was setup correctly from the CurrentActivity Plugin. 137 | 138 | #### Windows 10 UWP 139 | UWP has a limited set of supported permissions. You can see the documentation above, but current support: Contacts, Location, and Sensors. 140 | 141 | #### Contributors 142 | * Icon thanks to [Jérémie Laval](https://github.com/garuma) 143 | 144 | Thanks! 145 | 146 | #### License 147 | Licensed under main repo license(MIT) 148 | 149 | ### Want To Support This Project? 150 | All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down! Want to go further? Make sure to subscribe to my weekly development podcast [Merge Conflict](http://mergeconflict.fm), where I talk all about awesome Xamarin goodies and you can optionally support the show by becoming a [supporter on Patreon](https://www.patreon.com/mergeconflictfm). 151 | -------------------------------------------------------------------------------- /art/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/art/icon.png -------------------------------------------------------------------------------- /nuget/readme.txt: -------------------------------------------------------------------------------- 1 | Permissions Readme 2 | 3 | Introducing Version 5.0! There is a brand new API that introduces completely linker safe permissions for iOS, which is awesome! 4 | 5 | Please read: https://github.com/jamesmontemagno/PermissionsPlugin/blob/master/README.md for the new API 6 | 7 | 8 | **IMPORTANT** 9 | Android: 10 | 11 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) 12 | { 13 | PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); 14 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 15 | } 16 | 17 | ## Android Setup 18 | 19 | This plugin uses the [Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials/), please follow the setup guide. 20 | 21 | ```csharp 22 | Xamarin.Essentials.Platform.Init(this, bundle); 23 | ``` 24 | 25 | It is highly recommended that you use a custom Application that are outlined in the Current Activity Plugin Documentation](https://github.com/jamesmontemagno/CurrentActivityPlugin/blob/master/README.md) 26 | 27 | ### iOS Specific 28 | Based on what permissions you are using, you must add information into your info.plist. Please read the [Working with Security and Privacy guide for keys you will need to add](https://developer.xamarin.com/guides/ios/application_fundamentals/security-privacy-enhancements/). -------------------------------------------------------------------------------- /samples/PermissionsSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30002.166 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PermissionsSample", "PermissionsSample\PermissionsSample\PermissionsSample.csproj", "{6B9FD358-774A-4B06-BA02-D78B5FAA9F85}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PermissionsSample.Droid", "PermissionsSample\PermissionsSample.Droid\PermissionsSample.Droid.csproj", "{4EC7D108-1C68-4666-8676-500A09D4D2B9}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PermissionsSample.iOS", "PermissionsSample\PermissionsSample.iOS\PermissionsSample.iOS.csproj", "{24C09130-BDE2-4E54-A761-860B0F0EF662}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PermissionsSample.UWP", "PermissionsSample\PermissionsSample.UWP\PermissionsSample.UWP.csproj", "{03A44514-6155-43BE-8DEA-DB1F3E4F87AD}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|ARM = Debug|ARM 18 | Debug|iPhone = Debug|iPhone 19 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 20 | Debug|x64 = Debug|x64 21 | Debug|x86 = Debug|x86 22 | Release|Any CPU = Release|Any CPU 23 | Release|ARM = Release|ARM 24 | Release|iPhone = Release|iPhone 25 | Release|iPhoneSimulator = Release|iPhoneSimulator 26 | Release|x64 = Release|x64 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|ARM.ActiveCfg = Debug|Any CPU 33 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|ARM.Build.0 = Debug|Any CPU 34 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|iPhone.ActiveCfg = Debug|Any CPU 35 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|iPhone.Build.0 = Debug|Any CPU 36 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 37 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 38 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|x64.ActiveCfg = Debug|Any CPU 39 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|x64.Build.0 = Debug|Any CPU 40 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|x86.ActiveCfg = Debug|Any CPU 41 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Debug|x86.Build.0 = Debug|Any CPU 42 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|ARM.ActiveCfg = Release|Any CPU 45 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|ARM.Build.0 = Release|Any CPU 46 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|iPhone.ActiveCfg = Release|Any CPU 47 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|iPhone.Build.0 = Release|Any CPU 48 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 49 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 50 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|x64.ActiveCfg = Release|Any CPU 51 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|x64.Build.0 = Release|Any CPU 52 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|x86.ActiveCfg = Release|Any CPU 53 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85}.Release|x86.Build.0 = Release|Any CPU 54 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 57 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|ARM.ActiveCfg = Debug|Any CPU 58 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|ARM.Build.0 = Debug|Any CPU 59 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|ARM.Deploy.0 = Debug|Any CPU 60 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|iPhone.ActiveCfg = Debug|Any CPU 61 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|iPhone.Build.0 = Debug|Any CPU 62 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 63 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 64 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x64.ActiveCfg = Debug|Any CPU 65 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x64.Build.0 = Debug|Any CPU 66 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x64.Deploy.0 = Debug|Any CPU 67 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x86.ActiveCfg = Debug|Any CPU 68 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x86.Build.0 = Debug|Any CPU 69 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Debug|x86.Deploy.0 = Debug|Any CPU 70 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|Any CPU.ActiveCfg = Release|Any CPU 71 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|Any CPU.Build.0 = Release|Any CPU 72 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|ARM.ActiveCfg = Release|Any CPU 73 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|ARM.Build.0 = Release|Any CPU 74 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|ARM.Deploy.0 = Release|Any CPU 75 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|iPhone.ActiveCfg = Release|Any CPU 76 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|iPhone.Build.0 = Release|Any CPU 77 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 78 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 79 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x64.ActiveCfg = Release|Any CPU 80 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x64.Build.0 = Release|Any CPU 81 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x64.Deploy.0 = Release|Any CPU 82 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x86.ActiveCfg = Release|Any CPU 83 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x86.Build.0 = Release|Any CPU 84 | {4EC7D108-1C68-4666-8676-500A09D4D2B9}.Release|x86.Deploy.0 = Release|Any CPU 85 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 86 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 87 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|ARM.ActiveCfg = Debug|iPhone 88 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|iPhone.ActiveCfg = Debug|iPhone 89 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|iPhone.Build.0 = Debug|iPhone 90 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 91 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 92 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|x64.ActiveCfg = Debug|iPhone 93 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Debug|x86.ActiveCfg = Debug|iPhone 94 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator 95 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|Any CPU.Build.0 = Release|iPhoneSimulator 96 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|ARM.ActiveCfg = Release|iPhone 97 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|iPhone.ActiveCfg = Release|iPhone 98 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|iPhone.Build.0 = Release|iPhone 99 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 100 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 101 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|x64.ActiveCfg = Release|iPhone 102 | {24C09130-BDE2-4E54-A761-860B0F0EF662}.Release|x86.ActiveCfg = Release|iPhone 103 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|Any CPU.ActiveCfg = Debug|x86 104 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|Any CPU.Build.0 = Debug|x86 105 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|Any CPU.Deploy.0 = Debug|x86 106 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|ARM.ActiveCfg = Debug|ARM 107 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|ARM.Build.0 = Debug|ARM 108 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|ARM.Deploy.0 = Debug|ARM 109 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|iPhone.ActiveCfg = Debug|x86 110 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 111 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x64.ActiveCfg = Debug|x64 112 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x64.Build.0 = Debug|x64 113 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x64.Deploy.0 = Debug|x64 114 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x86.ActiveCfg = Debug|x86 115 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x86.Build.0 = Debug|x86 116 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Debug|x86.Deploy.0 = Debug|x86 117 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|Any CPU.ActiveCfg = Release|x86 118 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|ARM.ActiveCfg = Release|ARM 119 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|ARM.Build.0 = Release|ARM 120 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|ARM.Deploy.0 = Release|ARM 121 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|iPhone.ActiveCfg = Release|x86 122 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|iPhoneSimulator.ActiveCfg = Release|x86 123 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x64.ActiveCfg = Release|x64 124 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x64.Build.0 = Release|x64 125 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x64.Deploy.0 = Release|x64 126 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x86.ActiveCfg = Release|x86 127 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x86.Build.0 = Release|x86 128 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD}.Release|x86.Deploy.0 = Release|x86 129 | EndGlobalSection 130 | GlobalSection(SolutionProperties) = preSolution 131 | HideSolutionNode = FALSE 132 | EndGlobalSection 133 | GlobalSection(ExtensibilityGlobals) = postSolution 134 | SolutionGuid = {529904E6-8EE9-4DDE-8AB5-AE75B0E4F1D5} 135 | EndGlobalSection 136 | EndGlobal 137 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | using Android.Support.V4.App; 10 | using Plugin.Permissions; 11 | using Xamarin.Forms; 12 | using Xamarin.Forms.Platform.Android; 13 | 14 | namespace PermissionsSample.Droid 15 | { 16 | [Activity(Label = "PermissionsSample", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 17 | public class MainActivity : FormsAppCompatActivity 18 | { 19 | protected override void OnCreate(Bundle bundle) 20 | { 21 | base.OnCreate(bundle); 22 | ToolbarResource = Resource.Layout.toolbar; 23 | 24 | Forms.Init(this, bundle); 25 | Xamarin.Essentials.Platform.Init(this, bundle); 26 | LoadApplication(new App()); 27 | } 28 | 29 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) 30 | { 31 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); 32 | PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); 33 | 34 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 35 | } 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/PermissionsSample.Droid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4EC7D108-1C68-4666-8676-500A09D4D2B9} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | Properties 10 | PermissionsSample.Droid 11 | PermissionsSample.Droid 12 | 512 13 | true 14 | Resources\Resource.Designer.cs 15 | Off 16 | Properties\AndroidManifest.xml 17 | false 18 | v9.0 19 | 20 | 21 | 22 | 23 | 24 | False 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | None 35 | True 36 | armeabi-v7a;x86;arm64-v8a 37 | Xamarin 38 | True 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | armeabi,armeabi-v7a,x86 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | AndroidResource 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85} 85 | PermissionsSample 86 | 87 | 88 | 89 | 90 | 6.0.1 91 | 92 | 93 | 4.6.2-beta 94 | 95 | 96 | 1.5.2 97 | 98 | 99 | 4.5.0.530 100 | 101 | 102 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/PermissionsSample.Droid.csproj.bak: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4EC7D108-1C68-4666-8676-500A09D4D2B9} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | Properties 10 | PermissionsSample.Droid 11 | PermissionsSample.Droid 12 | 512 13 | true 14 | Resources\Resource.Designer.cs 15 | Off 16 | Properties\AndroidManifest.xml 17 | True 18 | v7.0 19 | 20 | 21 | 22 | 23 | 24 | False 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | None 35 | True 36 | armeabi-v7a;x86;arm64-v8a 37 | Xamarin 38 | True 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | armeabi,armeabi-v7a,x86 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll 56 | True 57 | 58 | 59 | 60 | 61 | ..\..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll 62 | True 63 | 64 | 65 | ..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\MonoAndroid10\Plugin.Geolocator.dll 66 | True 67 | 68 | 69 | ..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\MonoAndroid10\Plugin.Geolocator.Abstractions.dll 70 | True 71 | 72 | 73 | ..\..\packages\Plugin.Permissions.1.2.1\lib\MonoAndroid10\Plugin.Permissions.dll 74 | True 75 | 76 | 77 | ..\..\packages\Plugin.Permissions.1.2.1\lib\MonoAndroid10\Plugin.Permissions.Abstractions.dll 78 | True 79 | 80 | 81 | 82 | 83 | 84 | 85 | ..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll 86 | True 87 | 88 | 89 | ..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll 90 | True 91 | 92 | 93 | ..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll 94 | True 95 | 96 | 97 | ..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll 98 | True 99 | 100 | 101 | ..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll 102 | True 103 | 104 | 105 | ..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll 106 | True 107 | 108 | 109 | ..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll 110 | True 111 | 112 | 113 | ..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll 114 | True 115 | 116 | 117 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Core.dll 118 | True 119 | 120 | 121 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 122 | True 123 | 124 | 125 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 126 | True 127 | 128 | 129 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 130 | True 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | AndroidResource 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 168 | 169 | 170 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85} 171 | PermissionsSample 172 | 173 | 174 | 175 | 176 | 177 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("PermissionsSample.Droid")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("PermissionsSample.Droid")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.1.1")] 30 | [assembly: AssemblyFileVersion("1.1.1")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/layout/toolbar.axml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/values-v21/style.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | #2196F3 4 | #1976D2 5 | #FFC107 6 | #F5F5F5 7 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.Droid/Resources/values/style.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 11 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace PermissionsSample.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | Frame rootFrame = Window.Current.Content as Frame; 43 | 44 | // Do not repeat app initialization when the Window already has content, 45 | // just ensure that the window is active 46 | if (rootFrame == null) 47 | { 48 | // Create a Frame to act as the navigation context and navigate to the first page 49 | rootFrame = new Frame(); 50 | 51 | rootFrame.NavigationFailed += OnNavigationFailed; 52 | Xamarin.Forms.Forms.Init(e); // requires the `e` parameter 53 | 54 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 55 | { 56 | //TODO: Load state from previously suspended application 57 | } 58 | 59 | // Place the frame in the current Window 60 | Window.Current.Content = rootFrame; 61 | } 62 | 63 | if (e.PrelaunchActivated == false) 64 | { 65 | if (rootFrame.Content == null) 66 | { 67 | // When the navigation stack isn't restored navigate to the first page, 68 | // configuring the new page by passing required information as a navigation 69 | // parameter 70 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 71 | } 72 | // Ensure the current window is active 73 | Window.Current.Activate(); 74 | } 75 | } 76 | 77 | /// 78 | /// Invoked when Navigation to a certain page fails 79 | /// 80 | /// The Frame which failed navigation 81 | /// Details about the navigation failure 82 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 83 | { 84 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 85 | } 86 | 87 | /// 88 | /// Invoked when application execution is being suspended. Application state is saved 89 | /// without knowing whether the application will be terminated or resumed with the contents 90 | /// of memory still intact. 91 | /// 92 | /// The source of the suspend request. 93 | /// Details about the suspend request. 94 | private void OnSuspending(object sender, SuspendingEventArgs e) 95 | { 96 | var deferral = e.SuspendingOperation.GetDeferral(); 97 | //TODO: Save application state and stop any background activity 98 | deferral.Complete(); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 17 | 18 | namespace PermissionsSample.UWP 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | LoadApplication(new PermissionsSample.App()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PermissionsSample.UWP 7 | Motz 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/PermissionsSample.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {03A44514-6155-43BE-8DEA-DB1F3E4F87AD} 8 | AppContainerExe 9 | Properties 10 | PermissionsSample.UWP 11 | PermissionsSample.UWP 12 | en-US 13 | UAP 14 | 10.0.18362.0 15 | 10.0.18362.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | true 20 | PermissionsSample.UWP_TemporaryKey.pfx 21 | win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot 22 | 23 | 24 | true 25 | bin\x86\Debug\ 26 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 27 | ;2008 28 | full 29 | x86 30 | false 31 | prompt 32 | true 33 | 34 | 35 | bin\x86\Release\ 36 | TRACE;NETFX_CORE;WINDOWS_UWP 37 | true 38 | ;2008 39 | pdbonly 40 | x86 41 | false 42 | prompt 43 | true 44 | true 45 | 46 | 47 | true 48 | bin\ARM\Debug\ 49 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 50 | ;2008 51 | full 52 | ARM 53 | false 54 | prompt 55 | true 56 | 57 | 58 | bin\ARM\Release\ 59 | TRACE;NETFX_CORE;WINDOWS_UWP 60 | true 61 | ;2008 62 | pdbonly 63 | ARM 64 | false 65 | prompt 66 | true 67 | true 68 | 69 | 70 | true 71 | bin\x64\Debug\ 72 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 73 | ;2008 74 | full 75 | x64 76 | false 77 | prompt 78 | true 79 | 80 | 81 | bin\x64\Release\ 82 | TRACE;NETFX_CORE;WINDOWS_UWP 83 | true 84 | ;2008 85 | pdbonly 86 | x64 87 | false 88 | prompt 89 | true 90 | true 91 | 92 | 93 | 94 | App.xaml 95 | 96 | 97 | MainPage.xaml 98 | 99 | 100 | 101 | 102 | 103 | Designer 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | MSBuild:Compile 120 | Designer 121 | 122 | 123 | MSBuild:Compile 124 | Designer 125 | 126 | 127 | 128 | 129 | {6b9fd358-774a-4b06-ba02-d78b5faa9f85} 130 | PermissionsSample 131 | 132 | 133 | 134 | 135 | 6.2.10 136 | 137 | 138 | 6.0.1 139 | 140 | 141 | 4.6.2-beta 142 | 143 | 144 | 1.5.2 145 | 146 | 147 | 4.5.0.530 148 | 149 | 150 | 151 | 14.0 152 | 153 | 154 | 161 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PermissionsSample.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PermissionsSample.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace PermissionsSample.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | LoadApplication(new App()); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 6.0 25 | CFBundleDisplayName 26 | PermissionsTest 27 | CFBundleIdentifier 28 | com.yourcompany.PermissionsTest 29 | CFBundleVersion 30 | 1.0 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x 34 | Icon-60@3x 35 | Icon-76 36 | Icon-76@2x 37 | Default 38 | Default@2x 39 | Default-568h@2x 40 | Default-Portrait 41 | Default-Portrait@2x 42 | Icon-Small-40 43 | Icon-Small-40@2x 44 | Icon-Small-40@3x 45 | Icon-Small 46 | Icon-Small@2x 47 | Icon-Small@3x 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen 51 | NSLocationWhenInUseUsageDescription 52 | Can I haz location? 53 | CFBundleName 54 | PermissionsTest 55 | NSAppleMusicUsageDescription 56 | Music! 57 | NSBluetoothPeripheralUsageDescription 58 | bluetooth 59 | NSCalendarsUsageDescription 60 | Calendars 61 | NSCameraUsageDescription 62 | camera 63 | NSContactsUsageDescription 64 | contacts 65 | kTCCServiceMediaLibrary 66 | media 67 | NSMicrophoneUsageDescription 68 | microphone 69 | NSMotionUsageDescription 70 | motion 71 | NSPhotoLibraryUsageDescription 72 | photos 73 | NSRemindersUsageDescription 74 | reminders 75 | NSSpeechRecognitionUsageDescription 76 | speech 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace PermissionsSample.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/PermissionsSample.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | {24C09130-BDE2-4E54-A761-860B0F0EF662} 7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Exe 9 | PermissionsSample.iOS 10 | Resources 11 | PermissionsSampleiOS 12 | 13 | 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\iPhoneSimulator\Debug 20 | DEBUG 21 | prompt 22 | 4 23 | false 24 | i386, x86_64 25 | None 26 | true 27 | 28 | 29 | none 30 | true 31 | bin\iPhoneSimulator\Release 32 | prompt 33 | 4 34 | None 35 | i386, x86_64 36 | false 37 | 38 | 39 | true 40 | full 41 | false 42 | bin\iPhone\Debug 43 | DEBUG 44 | prompt 45 | 4 46 | false 47 | ARMv7, ARM64 48 | iPhone Developer 49 | true 50 | Entitlements.plist 51 | 52 | 53 | none 54 | true 55 | bin\iPhone\Release 56 | prompt 57 | 4 58 | ARMv7, ARM64 59 | false 60 | iPhone Developer 61 | Entitlements.plist 62 | 63 | 64 | 65 | 66 | 67 | 68 | Designer 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85} 103 | PermissionsSample 104 | 105 | 106 | 107 | 108 | 6.0.1 109 | 110 | 111 | 4.6.2-beta 112 | 113 | 114 | 1.5.2 115 | 116 | 117 | 4.5.0.530 118 | 119 | 120 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PermissionsSample.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PermissionsSample.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.1")] 36 | [assembly: AssemblyFileVersion("1.1.1")] 37 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Default.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/iTunesArtwork -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/samples/PermissionsSample/PermissionsSample.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample/App.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Xamarin.Forms; 7 | 8 | namespace PermissionsSample 9 | { 10 | public class App : Application 11 | { 12 | public App() 13 | { 14 | // The root page of your application 15 | MainPage = new NavigationPage(new GeolocationPage()); 16 | } 17 | 18 | protected override void OnStart() 19 | { 20 | // Handle when your app starts 21 | } 22 | 23 | protected override void OnSleep() 24 | { 25 | // Handle when your app sleeps 26 | } 27 | 28 | protected override void OnResume() 29 | { 30 | // Handle when your app resumes 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample/GeolocationPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample/GeolocationPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Plugin.Geolocator; 7 | using Plugin.Permissions; 8 | using Plugin.Permissions.Abstractions; 9 | using Xamarin.Forms; 10 | 11 | namespace PermissionsSample 12 | { 13 | public partial class GeolocationPage : ContentPage 14 | { 15 | public GeolocationPage() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | bool busy; 21 | async void ButtonPermission_OnClicked(object sender, EventArgs e) 22 | { 23 | if (busy) 24 | return; 25 | 26 | busy = true; 27 | ((Button) sender).IsEnabled = false; 28 | 29 | var status = PermissionStatus.Unknown; 30 | switch (((Button)sender).StyleId) 31 | { 32 | case "Calendar": 33 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 34 | break; 35 | case "Camera": 36 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 37 | break; 38 | case "Contacts": 39 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 40 | break; 41 | case "Microphone": 42 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 43 | break; 44 | case "Geolocation": 45 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 46 | break; 47 | case "Phone": 48 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 49 | break; 50 | case "Photos": 51 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 52 | break; 53 | case "Reminders": 54 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 55 | break; 56 | case "Sensors": 57 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 58 | break; 59 | case "Sms": 60 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 61 | break; 62 | case "Storage": 63 | status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 64 | break; 65 | case "Settings": 66 | CrossPermissions.Current.OpenAppSettings(); 67 | ((Button)sender).IsEnabled = true; 68 | busy = false; 69 | return; 70 | } 71 | 72 | await DisplayAlert("Pre - Results", status.ToString(), "OK"); 73 | 74 | if (status != PermissionStatus.Granted) 75 | { 76 | switch (((Button)sender).StyleId) 77 | { 78 | case "Calendar": 79 | status = await Utils.CheckPermissions(new CalendarPermission()); 80 | break; 81 | case "Camera": 82 | status = await Utils.CheckPermissions(new CameraPermission()); 83 | break; 84 | case "Contacts": 85 | status = await Utils.CheckPermissions(new ContactsPermission()); 86 | break; 87 | case "Geolocation": 88 | status = await Utils.CheckPermissions(new LocationPermission()); 89 | break; 90 | case "Microphone": 91 | status = await Utils.CheckPermissions(new MicrophonePermission()); 92 | break; 93 | case "Phone": 94 | status = await Utils.CheckPermissions(new PhonePermission()); 95 | break; 96 | case "Photos": 97 | status = await Utils.CheckPermissions(new PhotosPermission()); 98 | break; 99 | case "Reminders": 100 | status = await Utils.CheckPermissions(new RemindersPermission()); 101 | break; 102 | case "Sensors": 103 | status = await Utils.CheckPermissions(new SensorsPermission()); 104 | break; 105 | case "Sms": 106 | status = await Utils.CheckPermissions(new SmsPermission()); 107 | break; 108 | case "Storage": 109 | status = await Utils.CheckPermissions(new StoragePermission()); 110 | break; 111 | } 112 | 113 | await DisplayAlert("Results", status.ToString(), "OK"); 114 | 115 | } 116 | 117 | busy = false; 118 | ((Button) sender).IsEnabled = true; 119 | } 120 | 121 | async void Button_OnClicked(object sender, EventArgs e) 122 | { 123 | if (busy) 124 | return; 125 | 126 | busy = true; 127 | ((Button) sender).IsEnabled = false; 128 | 129 | try 130 | { 131 | var status = await CrossPermissions.Current.CheckPermissionStatusAsync(); 132 | if (status != PermissionStatus.Granted) 133 | { 134 | if(await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Location)) 135 | { 136 | await DisplayAlert("Need location", "Gunna need that location", "OK"); 137 | } 138 | 139 | status = await CrossPermissions.Current.RequestPermissionAsync(); 140 | } 141 | 142 | if (status == PermissionStatus.Granted) 143 | { 144 | var results = await CrossGeolocator.Current.GetPositionAsync(TimeSpan.FromSeconds(10)); 145 | LabelGeolocation.Text = "Lat: " + results.Latitude + " Long: " + results.Longitude; 146 | } 147 | else if(status != PermissionStatus.Unknown) 148 | { 149 | await DisplayAlert("Location Denied", "Can not continue, try again.", "OK"); 150 | } 151 | } 152 | catch (Exception ex) 153 | { 154 | 155 | LabelGeolocation.Text = "Error: " + ex; 156 | } 157 | 158 | ((Button)sender).IsEnabled = true; 159 | busy = false; 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample/PermissionsSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/PermissionsSample/PermissionsSample/Utils.cs: -------------------------------------------------------------------------------- 1 | using Plugin.Permissions; 2 | using Plugin.Permissions.Abstractions; 3 | using System.Threading.Tasks; 4 | using Xamarin.Forms; 5 | 6 | namespace PermissionsSample 7 | { 8 | public static class Utils 9 | { 10 | public static async Task CheckPermissions(BasePermission permission) 11 | { 12 | var permissionStatus = await permission.CheckPermissionStatusAsync(); 13 | bool request = false; 14 | if (permissionStatus == PermissionStatus.Denied) 15 | { 16 | if (Device.RuntimePlatform == Device.iOS) 17 | { 18 | 19 | var title = $"{permission} Permission"; 20 | var question = $"To use this plugin the {permission} permission is required. Please go into Settings and turn on {permission} for the app."; 21 | var positive = "Settings"; 22 | var negative = "Maybe Later"; 23 | var task = Application.Current?.MainPage?.DisplayAlert(title, question, positive, negative); 24 | if (task == null) 25 | return permissionStatus; 26 | 27 | var result = await task; 28 | if (result) 29 | { 30 | CrossPermissions.Current.OpenAppSettings(); 31 | } 32 | 33 | return permissionStatus; 34 | } 35 | 36 | request = true; 37 | 38 | } 39 | 40 | if (request || permissionStatus != PermissionStatus.Granted) 41 | { 42 | permissionStatus = await permission.RequestPermissionAsync(); 43 | 44 | 45 | if (permissionStatus != PermissionStatus.Granted) 46 | { 47 | var title = $"{permission} Permission"; 48 | var question = $"To use the plugin the {permission} permission is required."; 49 | var positive = "Settings"; 50 | var negative = "Maybe Later"; 51 | var task = Application.Current?.MainPage?.DisplayAlert(title, question, positive, negative); 52 | if (task == null) 53 | return permissionStatus; 54 | 55 | var result = await task; 56 | if (result) 57 | { 58 | CrossPermissions.Current.OpenAppSettings(); 59 | } 60 | return permissionStatus; 61 | } 62 | } 63 | 64 | return permissionStatus; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 |  2 | using Android.App; 3 | using Android.Content.PM; 4 | using Android.OS; 5 | using Plugin.Permissions; 6 | using Xamarin.Forms; 7 | using Xamarin.Forms.Platform.Android; 8 | 9 | namespace PermissionsTest.Droid 10 | { 11 | [Activity(Label = "PermissionsTest", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 12 | public class MainActivity : FormsAppCompatActivity 13 | { 14 | protected override void OnCreate(Bundle bundle) 15 | { 16 | 17 | base.OnCreate(bundle); 18 | 19 | Forms.Init(this, bundle); 20 | 21 | 22 | Xamarin.Essentials.Platform.Init(this, bundle); 23 | 24 | LoadApplication(new App()); 25 | } 26 | 27 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) 28 | { 29 | PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); 30 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/PermissionsTest.Droid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4EC7D108-1C68-4666-8676-500A09D4D2B9} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | Properties 10 | PermissionsTest.Droid 11 | PermissionsTest.Droid 12 | 512 13 | true 14 | Resources\Resource.Designer.cs 15 | Off 16 | Properties\AndroidManifest.xml 17 | false 18 | v10.0 19 | 20 | 21 | 22 | 23 | 24 | False 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | SdkOnly 35 | false 36 | armeabi-v7a;x86 37 | Xamarin 38 | True 39 | true 40 | 41 | 42 | pdbonly 43 | true 44 | bin\Release\ 45 | TRACE 46 | prompt 47 | 4 48 | armeabi-v7a;x86 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | AndroidResource 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | {6b9fd358-774a-4b06-ba02-d78b5faa9f85} 89 | PermissionsTest 90 | 91 | 92 | {52f807ad-504c-4dbe-8b0e-71b82cc78e9b} 93 | Plugin.Permissions 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/PermissionsTest.Droid.csproj.bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4EC7D108-1C68-4666-8676-500A09D4D2B9} 7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | Properties 10 | PermissionsTest.Droid 11 | PermissionsTest.Droid 12 | 512 13 | true 14 | Resources\Resource.Designer.cs 15 | Off 16 | Properties\AndroidManifest.xml 17 | True 18 | v7.0 19 | 20 | 21 | 22 | f41ba8b7 23 | False 24 | 25 | 26 | true 27 | full 28 | false 29 | bin\Debug\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | None 34 | True 35 | armeabi-v7a;x86;arm64-v8a 36 | Xamarin 37 | True 38 | 39 | 40 | pdbonly 41 | true 42 | bin\Release\ 43 | TRACE 44 | prompt 45 | 4 46 | armeabi,armeabi-v7a,x86 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll 57 | True 58 | 59 | 60 | 61 | 62 | 63 | 64 | ..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll 65 | 66 | 67 | ..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll 68 | 69 | 70 | ..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll 71 | 72 | 73 | ..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll 74 | 75 | 76 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll 77 | 78 | 79 | ..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll 80 | 81 | 82 | ..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll 83 | 84 | 85 | ..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll 86 | 87 | 88 | ..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll 89 | 90 | 91 | ..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Core.dll 92 | 93 | 94 | ..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 95 | 96 | 97 | ..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 98 | 99 | 100 | ..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | AndroidResource 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | {6B9FD358-774A-4B06-BA02-D78B5FAA9F85} 133 | PermissionsTest 134 | 135 | 136 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84} 137 | Plugin.Permissions.Android 138 | 139 | 140 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D} 141 | Plugin.Permissions.Abstractions 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("PermissionsTest.Droid")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("PermissionsTest.Droid")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.1.5")] 30 | [assembly: AssemblyFileVersion("1.1.5")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/layout/toolbar.axml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/values-v21/style.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | #2196F3 4 | #1976D2 5 | #FFC107 6 | #F5F5F5 7 | -------------------------------------------------------------------------------- /src/PermissionsTest.Droid/Resources/values/style.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 11 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace PermissionsTest.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | LoadApplication(new App()); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 6.0 25 | CFBundleDisplayName 26 | PermissionsTest 27 | CFBundleIdentifier 28 | com.refractored.permissions 29 | CFBundleVersion 30 | 1.0 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x 34 | Icon-60@3x 35 | Icon-76 36 | Icon-76@2x 37 | Default 38 | Default@2x 39 | Default-568h@2x 40 | Default-Portrait 41 | Default-Portrait@2x 42 | Icon-Small-40 43 | Icon-Small-40@2x 44 | Icon-Small-40@3x 45 | Icon-Small 46 | Icon-Small@2x 47 | Icon-Small@3x 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen 51 | NSLocationWhenInUseUsageDescription 52 | Need location when in use 53 | NSLocationAlwaysAndWhenInUseUsageDescription 54 | Always and when in use! 55 | NSLocationUsageDescription 56 | Older devices need location. 57 | NSLocationAlwaysUsageDescription 58 | Can I haz location always? 59 | CFBundleName 60 | PermissionsTest 61 | NSAppleMusicUsageDescription 62 | Music! 63 | NSBluetoothPeripheralUsageDescription 64 | bluetooth 65 | NSCalendarsUsageDescription 66 | Calendars 67 | NSCameraUsageDescription 68 | camera 69 | NSContactsUsageDescription 70 | contacts 71 | kTCCServiceMediaLibrary 72 | media 73 | NSMicrophoneUsageDescription 74 | microphone 75 | NSMotionUsageDescription 76 | motion 77 | NSPhotoLibraryUsageDescription 78 | photos 79 | NSRemindersUsageDescription 80 | reminders 81 | NSSpeechRecognitionUsageDescription 82 | speech 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace PermissionsTest.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/PermissionsTest.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | {24C09130-BDE2-4E54-A761-860B0F0EF662} 7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Exe 9 | PermissionsTest.iOS 10 | Resources 11 | PermissionsTestiOS 12 | 13 | 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\iPhoneSimulator\Debug 20 | DEBUG 21 | prompt 22 | 4 23 | false 24 | i386, x86_64 25 | None 26 | true 27 | 28 | 29 | none 30 | true 31 | bin\iPhoneSimulator\Release 32 | prompt 33 | 4 34 | None 35 | i386, x86_64 36 | false 37 | 38 | 39 | true 40 | full 41 | false 42 | bin\iPhone\Debug 43 | DEBUG 44 | prompt 45 | 4 46 | false 47 | ARMv7, ARM64 48 | iPhone Developer 49 | true 50 | Entitlements.plist 51 | 52 | 53 | SdkOnly 54 | 55 | 56 | 57 | 58 | none 59 | true 60 | bin\iPhone\Release 61 | prompt 62 | 4 63 | ARMv7, ARM64 64 | false 65 | iPhone Developer: James Montemagno (AMVKNEC6W3) 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | none 74 | True 75 | bin\iPhone\Ad-Hoc 76 | prompt 77 | 4 78 | False 79 | ARMv7, ARM64 80 | True 81 | Automatic:AdHoc 82 | iPhone Distribution 83 | Entitlements.plist 84 | 85 | 86 | none 87 | True 88 | bin\iPhone\AppStore 89 | prompt 90 | 4 91 | False 92 | ARMv7, ARM64 93 | Automatic:AppStore 94 | iPhone Distribution 95 | Entitlements.plist 96 | 97 | 98 | 99 | 100 | 101 | 102 | Designer 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 1.5.2 134 | 135 | 136 | 4.5.0.356 137 | 138 | 139 | 140 | 141 | {6b9fd358-774a-4b06-ba02-d78b5faa9f85} 142 | PermissionsTest 143 | 144 | 145 | {52f807ad-504c-4dbe-8b0e-71b82cc78e9b} 146 | Plugin.Permissions 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PermissionsTest.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PermissionsTest.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.5")] 36 | [assembly: AssemblyFileVersion("1.1.5")] 37 | -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Default.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/iTunesArtwork -------------------------------------------------------------------------------- /src/PermissionsTest.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesmontemagno/PermissionsPlugin/a0f7b5866d134137410fb39e2239474fdc03eb6b/src/PermissionsTest.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /src/PermissionsTest/App.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Xamarin.Forms; 7 | 8 | namespace PermissionsTest 9 | { 10 | public class App : Application 11 | { 12 | public App() 13 | { 14 | // The root page of your application 15 | MainPage = new NavigationPage(new GeolocationPage()); 16 | } 17 | 18 | protected override void OnStart() 19 | { 20 | // Handle when your app starts 21 | } 22 | 23 | protected override void OnSleep() 24 | { 25 | // Handle when your app sleeps 26 | } 27 | 28 | protected override void OnResume() 29 | { 30 | // Handle when your app resumes 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/PermissionsTest/GeolocationPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 |