Skip to content

Commit ccc07a6

Browse files
committed
Fix exception when OriginalUtc is not in user info
1 parent bb74d23 commit ccc07a6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

com.unity.mobile.notifications/Runtime/iOS/iOSNotification.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,19 @@ public iOSNotificationTrigger Trigger
389389
UtcTime = true,
390390
Repeats = data.trigger.calendar.repeats != 0
391391
};
392-
if (userInfo != null && userInfo["OriginalUtc"] == "0")
393-
trigger = trigger.ToLocal();
392+
if (userInfo != null)
393+
{
394+
string utc;
395+
if (userInfo.TryGetValue("OriginalUtc", out utc))
396+
{
397+
if (utc == "0")
398+
trigger = trigger.ToLocal();
399+
}
400+
else
401+
trigger.UtcTime = false;
402+
}
403+
else
404+
trigger.UtcTime = false;
394405
return trigger;
395406
}
396407
case iOSNotificationTriggerType.Location:

0 commit comments

Comments
 (0)