Prevent scheduling of local notifications in the past on iOS (check was already present on Android).

#rb [at]Peter.Sauerbrei, [at]Mathieu.Roy
#rnx


#ROBOMERGE-SOURCE: CL 8576758 via CL 8576774 via CL 8616299
#ROBOMERGE-BOT: (v409-8614070)

[CL 8627823 by francois guimond in Main branch]
This commit is contained in:
francois guimond
2019-09-10 17:39:02 -04:00
parent 3896fd9622
commit 12350ebd93

View File

@@ -142,6 +142,11 @@ static int32 NotificationNumber = 0;
int32 FIOSLocalNotificationService::ScheduleLocalNotificationAtTime(const FDateTime& FireDateTime, bool LocalTime, const FText& Title, const FText& Body, const FText& Action, const FString& ActivationEvent)
{
#if !PLATFORM_TVOS
if (FireDateTime < (LocalTime ? FDateTime::Now() : FDateTime::UtcNow()))
{
return -1;
}
//Create local copies of these for the block to capture
FDateTime FireDateTimeCopy = FireDateTime;
FText TitleCopy = Title;
@@ -173,6 +178,11 @@ int32 FIOSLocalNotificationService::ScheduleLocalNotificationAtTime(const FDateT
int32 FIOSLocalNotificationService::ScheduleLocalNotificationBadgeAtTime(const FDateTime& FireDateTime, bool LocalTime, const FString& ActivationEvent)
{
#if !PLATFORM_TVOS
if (FireDateTime < (LocalTime ? FDateTime::Now() : FDateTime::UtcNow()))
{
return -1;
}
FDateTime FireDateTimeCopy = FireDateTime;
FString ActivationEventCopy = ActivationEvent;
int32 CurrentNotificationId = NotificationNumber++;