How to enable / disable sharing iTunes files using the iPhone application

I have a requirement to enable / disable file sharing using the application. My iPhone application that shares all the data in documents to allow the user to back up data from iTunes so that he can recover later. I know that I can achieve this by changing the info.plist application to enable / disable sharing of iTunes files , but since I have to disable / enable it from the application i.e. on the application settings screen.

Please suggest me how to achieve this functionality.

Thanks for the answer.

+4
source share
2 answers

This cannot be done with code at runtime. There is a trick, but it can only be useful if you do not have a lot of data to exchange. Enable file sharing in plist. Then put all the files in the folder name, for example “Share”, and then set the switch to the user interface when the user turns off the switch, and then rename this folder like this “.Share”, then it will be hidden and no longer available for sharing .

Note: this trick is not a good way, but it works when you need it.

+3
source

Greetings, sorry for the time between request and response.

You are looking for the UIFileSharingEnabled key in the dashboard of your application.

The link to the developer pages no longer displays this information, or maybe I just can’t find it, but add it to your plist file

<key>UIFileSharingEnabled</key> <true/> 

amuses

+2
source

Source: https://habr.com/ru/post/1432655/


All Articles