8 Replies
      Latest reply on Feb 18, 2019 12:55 AM by eskimo
      PopeOfDOR Level 1 Level 1 (0 points)

        Good morning everybody.

        I want to program an simple app (for testing something etc.). I want to read out the BatteryLevel, the BatteryState and it would be possible to show the temperature of the battery. We are a company for wireless charging, this could be a nice information.

        For BatteryLevel and -state, I found that code, it's still working:

        UIDevice.currentDevice().batteryLevel
        UIDevice.currentDevice().batteryState.rawValue
        

         

        Is there a good function to see the temperature of the device or it's battery?

         

        That would be very nice!

         

        I'm using swift.

         

        Thanks

        PopeOfDOR

        • Re: Find out battery temperature of iPhone
          eskimo Apple Staff Apple Staff (10,695 points)

          Is there a good function to see the temperature of the device or it's battery?

          No.

          Share and Enjoy

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

            • Re: Find out battery temperature of iPhone
              jesperjesper Level 1 Level 1 (0 points)

              Is this still the case?

               

              We can't get the temperature of the battery?

               

              Is it possible to get the temperature of the iPhone?

               

              Best

              Jesper

                • Re: Find out battery temperature of iPhone
                  eskimo Apple Staff Apple Staff (10,695 points)

                  Is this still the case?

                  Yes.

                  Normally I end responses like the one above with “If you’d like to see such functionality added to the system, please file an enhancement request.”  Here I didn’t do that, because I doubt that such an enhancement request would get any traction.  iOS does not, in general, provide APIs for getting low-level hardware details like this.

                  Share and Enjoy

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

                    • Re: Find out battery temperature of iPhone
                      ssokol Level 1 Level 1 (0 points)

                      Quinn,

                       

                      Do you think an enhancement request for an API that keeps the app informed of thermal stress might be better received?

                       

                      We use iOS devices in situations where a shutdown due to overheating would be quite inconvenient but is a distinct possibility (outside in direct sunlight, in a hot aircraft cockpit). Providing a way for the system to inform the app that it is approaching some sort of terminal threshold would be quite useful. Similar to the didReceiveMemoryWarning(), this warning (probably sent as a Notification) would let the app and the user to know that the device is approaching the shutdown point, allowing them to take action.

                       

                      I think this sticks closer to the spirit of iOS - apps don't need to know about the internal details (the actual temperature) but they do need to some level of situational awareness.

                       

                      Thanks,

                       

                      Steve

                        • Re: Find out battery temperature of iPhone
                          eskimo Apple Staff Apple Staff (10,695 points)

                          Do you think an enhancement request for an API that keeps the app informed of thermal stress might be better received?

                          No, but only because we already have that API (-:  Check out the thermalState property on NSProcessInfo.

                          Share and Enjoy

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