How to change scenes after iOS user is idle

I need to load a new scene after a iPad/iPhone user is idle for about 5 minutes, what’s the best way to go about doing this?

I don’t know much about iOS dev but I will try to help you:
Ps: Note that there is a “!” in the first if statement.

  If(!//add input class here ){
     Idletime+1 * Time.deltaTime;
    If//add input class here){
     Idletime = 0;
    If(Idletime = 300){