Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix save media permission #118

Merged
merged 4 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MediaGallery/MediaGallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageId>Xamarin.MediaGallery</PackageId>
<PackageTags>maui, xamarin, .net6, ios, android, toolkit, xamarin.forms, media, picker, photos, videos, mediapicker</PackageTags>
<Description>This plugin is designed for picking and saving photos and video files from the native gallery of Android and iOS devices</Description>
<Version>2.2.0</Version>
<Version>2.2.1</Version>
<Authors>dimonovdd</Authors>
<Owners>dimonovdd</Owners>
<RepositoryUrl>https://github.com/dimonovdd/Xamarin.MediaGallery</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion Permission/Xamarim.MediaGallery.Permission.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageTags>maui, xamarin, .net6, ios, android, toolkit, xamarin.forms, media, picker, photos, videos, mediapicker</PackageTags>
<Description>This plugin is designed for picking and saving photos and video files from the native gallery of Android and iOS devices</Description>
<Version>2.2.0</Version>
<Version>2.2.1</Version>
<Authors>dimonovdd</Authors>
<Owners>dimonovdd</Owners>
<RepositoryUrl>https://github.com/dimonovdd/Xamarin.MediaGallery</RepositoryUrl>
Expand Down
10 changes: 7 additions & 3 deletions Permission/src/Permission/SaveMediaPermission.android.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using Android;
using System;
using Android;
using Android.OS;

namespace NativeMedia
{
public partial class SaveMediaPermission
{
/// <summary>List of required declarations.</summary>
public override (string androidPermission, bool isRuntime)[] RequiredPermissions =>
new (string, bool)[] { (Manifest.Permission.WriteExternalStorage, true) };
public override (string androidPermission, bool isRuntime)[] RequiredPermissions
=> (int)Build.VERSION.SdkInt >= 29
? Array.Empty<(string, bool)>()
: new (string, bool)[] { (Manifest.Permission.WriteExternalStorage, true) };
}
}
2 changes: 1 addition & 1 deletion Permission/src/Permission/SaveMediaPermission.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace NativeMedia
{
/// <summary>Permission "NSPhotoLibraryAddUsageDescription" for iOS and "WRITE_EXTERNAL_STORAGE" for Android</summary>
/// <summary>Permission "NSPhotoLibraryAddUsageDescription" for iOS and "WRITE_EXTERNAL_STORAGE" for Android < 10</summary>
public sealed partial class SaveMediaPermission : EssentialsEx.Permissions.BasePlatformPermission
{
}
Expand Down
2 changes: 1 addition & 1 deletion Sample/Common/Maui/Sample.Common.Maui.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-android33.0;net6.0-ios;</TargetFrameworks>
Expand Down
2 changes: 1 addition & 1 deletion Sample/Common/Xamarin/Sample.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand Down
4 changes: 0 additions & 4 deletions Sample/Common/src/FodyWeavers.xml

This file was deleted.

74 changes: 0 additions & 74 deletions Sample/Common/src/FodyWeavers.xsd

This file was deleted.

4 changes: 2 additions & 2 deletions Xamarim.MediaGallery.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<_UseNuget>true</_UseNuget>
<_UseNuget Condition="'$(Configuration)'=='Release'">true</_UseNuget>
<_LibVersion>2.2.0</_LibVersion>
<_PermissionLibVersion>2.2.0</_PermissionLibVersion>
<_LibVersion>2.2.1</_LibVersion>
<_PermissionLibVersion>2.2.1</_PermissionLibVersion>
<_IsSample Condition="'$(_IsSample)'!='false'">true</_IsSample>
<_NET6 Condition=" $(TargetFramework.StartsWith('net6')) ">true</_NET6>
<_IsMobele Condition=" $(TargetFramework.Contains('droid')) OR $(TargetFramework.ToLowerInvariant().Contains('ios')) ">true</_IsMobele>
Expand Down