iOS Question File Data Protection

Discussion in 'iOS Questions' started by schimanski, May 16, 2018.

  1. schimanski

    schimanski Well-Known Member Licensed User

    Apple uses a system named File Data Protection to protect the app-data in the directories "documents/“ und „library/“. There are four types von file-protection:


    NSFileProtectionComplete,
    NSFileProtectionCompleteUnlessOpen,
    NSFileProtectionCompleteUntilFirstUserAuthentication and
    NSFileProtectionNone.


    Is there a way to set the file protection by code?


    Thanks for answer!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    1. Enable data protection in your App Id (you might need an explicit app id):

    [​IMG]

    2. Create a new provision profile.

    3. Add to your project:
    Code:
    #Entitlement: <key>com.apple.developer.default-data-protection</key><string>NSFileProtectionComplete</string>
    This seems to work though it is not clear how it can be tested.
     
  3. schimanski

    schimanski Well-Known Member Licensed User

    Wow..That's top!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice