1 Reply
      Latest reply on Jan 25, 2019 2:27 AM by eskimo
      Teresa de Jesus Level 1 Level 1 (0 points)

        Hi Community,

         

        My app was rejected due the use of com.apple.security.temporary-exception.shared-preference.read-write entitlement.

        The core functionality of the app is to manage taken screenshots and the reason of use that entitlement is to read/write the location value of the taken screenshots ()com.apple.screencapture).

         

        I'm currently writing with this:

        UserDefaults.standard.setPersistentDomain(locationJSON, forName: "com.apple.screencapture")

        to modify the location.

         

        The app was rejected and I need to found a way to write this value in a sandbox app.

         

        Any suggestions?

         

        Thank you in advance.

        • Re: App rejected due the use of com.apple.security.temporary-exception.shared-preference.read-write
          eskimo Apple Staff Apple Staff (11,625 points)

          The app was rejected and I need to found a way to write this value in a sandbox app.

          While your app was rejected for a technical reason, there’s an underlying policy issue here.  Sandboxed apps are not allowed to make changes that affect the system as a whole, and that includes this preference.  If you found a way around the sandbox restriction, it would be considered a security vulnerability.

          You have a couple of options here:

          • You can use a non-sandboxed app, distributed outside of the Mac App Store under the aegis of the Developer ID programme.

          • You can file an enhancement request for a sandbox-compatible way to do this task.  There are lots of places where sandboxed apps are allowed to make global changes like this, but such changes are always mediated by the system (often based on user authorisation) and thus need a dedicated API (as opposed to the very general UserDefaults API).

          Note If you do the latter, please post your bug number, just for the record.

          Also, there’s nothing stopping you doing both of these.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"