Find out battery temperature of iPhone

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

Replies

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"

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

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"

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

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"

Thank you very much! That's exactly what I was looking for.

You should mark Quinn answer as correct. That makes forum easier to browse.


Good continuation.

You should mark Quinn answer as correct.

Unfortunately, only the thread originator can mark something as correct [1], and my answer doesn’t address the original problem.

This is a good reason to create new threads for new problems, even if they’re closely related.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] Well, various Apple Staff folks can do that as well, but marking my own questions seems a little presumptuous.