Igor Strekha
Igor Strekha

Reputation: 194

How can I open txt file from Icloud drive using Xamarin.Essentials: File Picker?

Help me please about opening txt files on iPhone.

private async  Task ExecuteOpenFileCommandAsync()
    {
        Device.BeginInvokeOnMainThread(async () =>
        {
            var customFileType =
                new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
                {
                    { DevicePlatform.iOS, new[] { "blablabla" } },
                    { DevicePlatform.Android, new[] { "text/plain" } }
                });
            var options = new PickOptions
            {
                PickerTitle = "Please select a file",
                FileTypes = customFileType,
            };
            await PickAndShow(options);
        });
    }

I dont know, what I need to write instead "blablabla"

Thank you.

Upvotes: 0

Views: 258

Answers (1)

Igor Strekha
Igor Strekha

Reputation: 194

I found the answer "public.text" resolved the problem.

Upvotes: 1

Related Questions