Hello,
I’m trying to make an app that sends a local notification to the user after some time.
I tried with time.deltatime:
var startTime = 0.0;
var tempo1 = 50.0;
function Start()
{
var notif = new LocalNotification();
notif.alertBody = "Che ora è?";
NotificationServices.ScheduleLocalNotification(notif);
}
function Update()
{
startTime += Time.deltaTime;
if (startTime >= tempo1) {
Debug.Log ("About to play aiff.");
var notif = new LocalNotification();
notif.alertAction = "alert";
notif.alertBody = "Playing aiff sound";
notif.applicationIconBadgeNumber = -1;
notif.soundName = notif.defaultSoundName;
NotificationServices.ScheduleLocalNotification(notif);
}
}
but it seems that the time is not passing while the app is in background
do you have any suggestions?
thanks in advance