Poweroff API in iPhone

Hi Friends,

Currently, I am doing an iPhone app in which I have to store the time when iPhone is powered off by the user. So whenever iphone turns off i have to store that time and location, only then I have ? to allow the iphone to shut down. I really don't know how to do this. I surfed through the internet but i did not find anything useful. I have to do this as soon as possible. So please help with this. Atleast tell me whether it is possible iphone or not? Thanks in advance. ?
I don't think it's possible, but I could be wrong.
I don't believe that there's a way


Sent from my [Gold] iPhone 5S

Original thread: https://forums.imore.com/threads/poweroff-api-in-iphone.274303/