2 Replies
      Latest reply on Apr 22, 2016 10:39 AM by pdm
      Henry.Hins Level 1 Level 1 (0 points)

        I would like to use 3D Touch in my app and I want to provide virbation feedbacks to the user when 3D Touch is used.


        I've searched online and I found these three methods.


        import AudioToolbox
        AudioServicesPlaySystemSound(1519) // Actuate `Peek` feedback (weak boom)
        AudioServicesPlaySystemSound(1520) // Actuate `Pop` feedback (strong boom)
        AudioServicesPlaySystemSound(1521) // Actuate `Nope` feedback (series of three weak booms)

        (from http://stackoverflow.com/a/36320245/2577123)


        The method AudioServicesPlaySystemSound is documented in the API reference, but however the documentation didn't state what those numbers mean.


        So I wanna ask, do these 3 methods count as private APIs?

        Would I be rejected for scholarship if I include any private API in my app?

        Thank you.

        • Re: Does this count as a private API?
          KMT Level 9 Level 9 (15,735 points)

          About using vibrate for feedback in your example, AFAIK, there is no public API. If you don't want the risk, don't take it. Use the bug reporter if you like to make a feature request.


          About 'AudioServicesPlaySystemSound' ...from the docs:


          "You can use System Sound Services to play short (30 seconds or shorter) sounds."

          • Re: Does this count as a private API?
            pdm Apple Staff Apple Staff (1,770 points)

            As KMT correctly points out, there isn't public API for invoking the haptic feedback used in 3D Touch.  It's a commonly requested feature, which you can add a +1 onto the pile by filing a bug report (we do pay attention to the number of dupes that bug reports get).  It would not be appropriate to use undocumented arbitrary values in APIs, so I would recommend you not do that in your submission.