iOS method similar to GetExternalFilesDir? #22523
Unanswered
CodingOctocat
asked this question in
Q&A
Replies: 1 comment
-
This is my solution, is it correct? using Foundation;
namespace FireCamera.Helpers;
public static partial class StorageHelper
{
public static partial string GetExternalCacheDir()
{
string path = NSFileManager.DefaultManager.GetUrl(
NSSearchPathDirectory.CachesDirectory,
NSSearchPathDomain.User,
null,
true,
out var _).AbsoluteString!;
return path;
}
public static partial string GetExternalFilesDir(string? folder)
{
string path = NSFileManager.DefaultManager.GetUrl(
NSSearchPathDirectory.DocumentDirectory,
NSSearchPathDomain.User,
folder is null ? null : new NSUrl(folder, true),
true,
out var _).AbsoluteString!;
return path;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi~ I'm a MAUI beginner, my program generates a lot of user data, so I choose to store the data in an external storage
/Android/data/com.xxx.yyy/files
:My App also needs to support iOS, but I don't know how to get a directory with the same concept. I think I really need a table comparing storage paths for Android/iOS.
I read the article: How many solution save local data on mobile for iOS Developer.
I think this is exactly what I want, but how do I use it in MAUI?
Beta Was this translation helpful? Give feedback.
All reactions