Saving a Document to the Device and Opening with Word iOS 17 opens in READ ONLY

Saving the document to the device and then opening it. Opens the Document in Read Only. This problem only started with iOS 17 it works 100% with iOS 16.

//Document

MemoryStream stream = new MemoryStream();

document.Save(stream, FormatType.Docx);

Xamarin.Forms.DependencyService.Get<ISave>().SaveAndView("Sample.docx", "application/msword", stream);

//Open

    public async Task SaveAndView(string filename, string contentType, MemoryStream stream)

    {

        UIDocumentInteractionController uIDocumentInteractionController = null;

        string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

        string filePath = Path.Combine(path, filename);

        uIDocumentInteractionController = UIDocumentInteractionController.FromUrl(NSUrl.FromFilename(filePath));

        uIDocumentInteractionController.Uti = "com.microsoft.word.doc";

        UIView presentingView = UIApplication.SharedApplication.KeyWindow.RootViewController.View;

        uIDocumentInteractionController.PresentOpenInMenu(CGRect.Empty, presentingView, true);

    }

Visual Studio 2022 17.7.5

Xamarin.Forms 5.0.0.2612

Syncfusion.Xamarin.DocIO 23.1.43

iPadOS 17.1

Word Version 2.78.2


9 Replies


SB Sneha Biju Syncfusion Team November 1, 2023 12:23 PM UTC

Hi Deon,

We suspect that the file might be used by other resources, so it is showing in read-only mode. Could you please check and release the resources (Dispose or Close) in your application?

In the meantime, we will try to replicate the same problem in the mentioned device configuration on our side to investigate further. If possible, could you please confirm whether this issue occurs on the device only or in the simulator as well? This information will be more helpful in expediting our investigation.

Regards,
Sneha.



DE Deon November 1, 2023 12:57 PM UTC

Hi Sneha

I am making use of an physical device and using devices on Browser Stack. I am closing other resources as well in my code before attempting to open.


We also tried creating the file within word and saving and used the app to try an open the file within the Xamarin app using MSWord with editing permissions but no luck.


We also tried opening from Environment.SpecialFolder.MyDocuments/Personal without success.

The issue appears to be only from iOS17/iPadOS 17 upwards.



SB Sneha Biju Syncfusion Team November 2, 2023 03:20 PM UTC

Hi Deon,

We suspect that the reported issue is with the viewer control and it is not related to DocIO. We will try to replicate the problem in the mentioned device configuration on our side to investigate further and share more details on November 6, 2023.

Regards,
Sneha.



SB Sneha Biju Syncfusion Team November 6, 2023 01:13 PM UTC

Deon, based on the given details, we suspect that the reported issue is not related to Syncfusion. Can you please confirm if the same issue occurs even after removing all the Syncfusion control related code? 

If yes, then the reported issue is not related to Syncfusion; it is due to the Xamarin Application. While searching for similar issues, we found a query related to the same issue. You can refer to it here. Additionally, you can update your issue details in the same query to resolve the generic issue in the Xamarin App and follow up there.

If the issue is specifically related to the Syncfusion control, please kindly share a simple sample with the code logic used on your end. This will allow us to try and replicate the same issue on the iOS 17 Simulator and provide you with further details.



DE Deon November 6, 2023 01:29 PM UTC

Hi, I have attached the sample Project that you can run on iOS 17 and it should provide the same Word/Read only issue. 


The thread you are referring to I have created a while back, but the solutions provided did not resolve the issue in any way.


Attachment: Word_2518688c.zip


SB Sneha Biju Syncfusion Team November 7, 2023 01:30 PM UTC

Deon, we have modified the given sample by removing the Syncfusion related code. Could you please test this sample on your end and confirm whether same issue occurs.

If yes, then you can follow up this issue in Microsoft community itself to get solution since it is not related to Syncfusion controls.


Attachment: Wording_dc36a2f0.zip


DE Deon November 8, 2023 05:47 AM UTC

Hi Sneha


Have you tested it with iOS 17 and does your document open as non read only ?


The code provided also opens in read-only unfortunately. I have opened another thread with Microsoft, hopefully they come back with answers.


thanks,



SB Sneha Biju Syncfusion Team November 9, 2023 11:22 AM UTC

Deon, we are trying to narrow down the given sample to determine whether the problem lies within the Syncfusion control or the Xamarin application. Therefore, we have not yet tested the sample with IOS 17. As per your previous update, We have confirmed that the problem lies with the general Xamarin application. We also suggest you follow the thread you opened in Microsoft to find a solution for this problem since it is not specific to Syncfusion and is a generic problem in the Xamarin application.


Loader.
Up arrow icon