2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-02-07 09:15:10 -05:00
|
|
|
|
2019-02-05 18:09:08 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
2019-04-17 22:57:00 -04:00
|
|
|
#include "Delegates/Delegate.h"
|
2019-02-05 18:09:08 -05:00
|
|
|
|
|
|
|
|
class BACKGROUNDHTTP_API FBackgroundHttpNotificationObject
|
|
|
|
|
: public TSharedFromThis<FBackgroundHttpNotificationObject, ESPMode::ThreadSafe>
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-06-05 21:01:17 -04:00
|
|
|
FBackgroundHttpNotificationObject(FText InNotificationTitle, FText InNotificationBody, FText InNotificationAction, const FString& InNotificationActivationString, bool InNotifyOnlyOnFullSuccess);
|
|
|
|
|
FBackgroundHttpNotificationObject(FText InNotificationTitle, FText InNotificationBody, FText InNotificationAction, const FString& InNotificationActivationString, bool InNotifyOnlyOnFullSuccess, bool bOnlySendNotificationInBackground);
|
2019-02-05 18:09:08 -05:00
|
|
|
~FBackgroundHttpNotificationObject();
|
|
|
|
|
|
|
|
|
|
void NotifyOfDownloadResult(bool bWasSuccess);
|
|
|
|
|
|
2019-04-17 22:57:00 -04:00
|
|
|
private:
|
|
|
|
|
void OnApp_EnteringBackground();
|
|
|
|
|
void OnApp_EnteringForeground();
|
|
|
|
|
|
2019-02-05 18:09:08 -05:00
|
|
|
private:
|
|
|
|
|
FText NotificationTitle;
|
|
|
|
|
FText NotificationAction;
|
|
|
|
|
FText NotificationBody;
|
|
|
|
|
FString NotificationActivationString;
|
|
|
|
|
|
2019-04-17 22:57:00 -04:00
|
|
|
bool bOnlySendNotificationInBackground;
|
2019-02-05 18:09:08 -05:00
|
|
|
bool bNotifyOnlyOnFullSuccess;
|
2019-04-17 22:57:00 -04:00
|
|
|
|
|
|
|
|
volatile bool bIsInBackground;
|
2019-02-05 18:09:08 -05:00
|
|
|
volatile int32 NumFailedDownloads;
|
|
|
|
|
|
|
|
|
|
class ILocalNotificationService* PlatformNotificationService;
|
|
|
|
|
|
2019-04-17 22:57:00 -04:00
|
|
|
FDelegateHandle OnApp_EnteringForegroundHandle;
|
|
|
|
|
FDelegateHandle OnApp_EnteringBackgroundHandle;
|
|
|
|
|
|
2019-02-05 18:09:08 -05:00
|
|
|
//No default constructor
|
|
|
|
|
FBackgroundHttpNotificationObject() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef TSharedPtr<FBackgroundHttpNotificationObject, ESPMode::ThreadSafe> FBackgroundHttpNotificationObjectPtr;
|