2 Replies
      Latest reply on Apr 3, 2018 2:07 AM by eskimo
      NCL602 Level 1 Level 1 (0 points)



        I checked that the ambient light sensor is in apple watch.


        So, I want to get data from ambient light sensor for checking the power of the light.


        But I can't find any API document about the getting ambient light sensor.


        And I found some article which to use ambient light sensor value is impossible.


        is it ture?


        I can't find the any official document about this.


        if it is possible, i don't care which language should i have to use.


        please give me some official document or your experince.

        • Re: Light sensor API on WatchOS
          Claude31 Level 8 Level 8 (6,655 points)

          Did you look at this thread, a few posts behind ?


          h ttps://forums.developer.apple.com/thread/99489

          • Re: Light sensor API on WatchOS
            eskimo Apple Staff Apple Staff (12,105 points)

            I want to expand on KMT’s answer here:

            There is no Public API that allows that access.

            He’s absolutely right.  There is no supported way to read the ambient light sensor on any of Apple’s platforms.  You may see various posts about techniques for doing this, but:

            • These techniques are unsupported.  They all depend on private APIs, or infrastructure that’s considered private.

            • Using private APIs is likely to cause problems with App Review.

            • Even if you product doesn’t go through App Review, you may run into compatibility problems down the line.  This may be the result of the sandbox getting better at restricting access to private APIs, or it may just be accidental breakage caused by architectural changes.  For an  example of the latter, read this thread.

            • DevForums is not the right place to discuss unsupported techniques.

            Share and Enjoy

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