[AC-5234] iOS 11: Ti.Media.saveToPhotoGallery is broken and causes app to crash
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-10-20T21:54:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | David Fox |
Assignee | Shak Hossain |
Created | 2017-09-26T03:16:54.000+0000 |
Updated | 2018-08-14T06:45:46.000+0000 |
Description
Any call to Ti.Media.saveToPhotoGallery on iOS 11 with any Titanium SDK causes the app to crash with no error or messaging in the console. The permission dialog is never shown. Same code with iOS 10.1 works fine.
Hi Hans, Thanks a bunch for the info, that was the issue and adding that permission fixed it! Glad to see that PR, that will definitely be helpful. I'm not sure if it's in the documentation anywhere but I didn't see anything off hand - it might be helpful to add what you wrote here maybe. Thanks again.
@Hans Knochel Is there any method to check/request that permission like Ti.Media.has***** and Ti.Media.request**** ??? Currently the code for save to gallery is executed before the permissions popup by iOS.
This code works for me(iOS 11.4.1, iPX):
If there is no permissions granted, I request them. in tiapp.xml you have to add this:
Hans or somebody from appc, can you please modify docs and put this info there? Because there is no single word about missing key and permissions... Thanks
Thanks for the feedback [~max87]. Note that it is
hasPhotoGalleryPermissions()
nothasPhotoGalleryPermissions
. The latter one will always be true, because the function itself always exists (which is what you are checking).Yeah, you're right and I'm sorry, it's a typo(I can't edit my previous comment to correct it)
PR to update the docs: https://github.com/appcelerator/titanium_mobile/pull/10252