[TIMOB-25912] iOS: Ti.UI.iOS.createDocumentViewer doesn't work when using SDK-fix
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-04-03T16:44:34.000+0000 |
Affected Version/s | Release 7.1.0, Release 7.0.2 |
Fix Version/s | Release 7.1.1 |
Components | iOS |
Labels | createHttpClient, documentViewer, filesystem |
Reporter | josh.mocek |
Assignee | Hans Knöchel |
Created | 2018-03-27T22:04:07.000+0000 |
Updated | 2018-04-05T20:36:04.000+0000 |
Description
Ti.UI.iOS.createDocumentViewer does not work correctly in 7.1.0
Build the sample project and copy the files below.
If you build the project w/ 7.1.0 on iOS >=11.2 and click on PDF or PNG it works, but DOCX, PPT, video, and XLS do not work and just show 'Loading...' forever. This is also after moving the files to the 'tmp' directory as stated in the docs to account for iOS 11.2.
If you build the project w/ 6.2.2 on iOS >=11.2 all the files open correctly.
Attachments
File | Date | Size |
index.js | 2018-03-27T21:56:26.000+0000 | 4296 |
index.tss | 2018-03-27T21:56:26.000+0000 | 144 |
index.xml | 2018-03-27T21:56:26.000+0000 | 438 |
This is holding up a release of ours, we have tested in 6.2.2 and everything works as expected, but we are needing to be on 7.1 for other fixes. Would love it if it were possible to get this regression fix into 7.1.1
Hey there! I've checked it and it looks like Apple also has some issues with the applicationCache directory. A simple fix is to change the
Ti.Filesystem.tempDirectory
references toTi.Filesystem.applicationDataDirectory
. Here is a working (classic) test-case based on your input (thanks for that!):Interesting enough: It works fine with PDF's - even with an untouched test-case, so it seems like PDF files are okay but others may not? Of course I've only tested with PDF files during the initial change for 7.1.0 so it probably went through. Still a buggy behavior on the native side, sorry for the trouble caused by that!
That does work. I tried putting it in a subdirectory in applicationDataDirectory, but I still couldn't access them there. PDF's still work fine
Thanks for testing! I am preparing a fix that moves all files to the application-data (root) directory to be picked up properly AND be removed if manually copied there. That also prevents possible storage leaks for larger amount of data as the file will be removed after finishing to present it. Does that make sense for your case as well?
PR: https://github.com/appcelerator/titanium_mobile/pull/9968 Backport: https://github.com/appcelerator/titanium_mobile/pull/9977 Test-Case:
Expected behavior: All files should load in iOS < 11.2 and iOS >= 11.2.
FR Passed. Able to load PDF, XLS, PPT, MP4, PNG, and DOCX files without issue. Tested using provided sample code as well as modified versions to accept other file types and the document viewer suite.
Verified changes are in SDK builds 7.1.1.v20180405080421 & 7.2.0.v20180404233630