how to save PlayerPrefs on App exit?

I have a script in which after 4 hours, bonus level is unlocked. it works fine in unity editor but It doesn’t work on android built. I guess there might be something wrong with OnApplicationQuit() but I tried OnApplicationPause() and OnApplicationFocus() either but none of them worked! I really don’t know what to do! here is my script;

     using UnityEngine;
     using System.Collections;
     using System;
     using System.Globalization;
     
     public class Date : MonoBehaviour
     {
     DateTime currentDate;
     DateTime oldDate;
     public static bool bonus;

     void Start()
 {
     currentDate = System.DateTime.Now;

     var oldTimeString = PlayerPrefs.GetString("sysString", "10");

     if(!string.IsNullOrWhiteSpace(oldTimeString))
     {
         
         if(long.TryParse(oldTimeString, out var temp))
         {
             var oldDate = DateTime.FromBinary(temp);
             var difference = currentDate.Subtract(oldDate);
             if(difference.Hours>4)
             {
                 bonus=true;
             }
         }
     }
 }
      void OnApplicationPause(bool pauseStatus)
     {
     	if(pauseStatus){
     		 PlayerPrefs.SetString("sysString", System.DateTime.Now.ToBinary().ToString());
     		 PlayerPrefs.Save();
     	}

     }
 
 }

Have you tried attaching the debugger to your build? Alternatively you could add a text Component to display messages. But I recommend getting used to using the debugger. It’s a bit of an adventure at first, but worth it.