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
# include "IOS/ApplePlatformBackgroundHttp.h"
# include "IOS/ApplePlatformBackgroundHttpManager.h"
# include "IOS/ApplePlatformBackgroundHttpRequest.h"
# include "IOS/ApplePlatformBackgroundHttpResponse.h"
# include "IOS/IOSBackgroundURLSessionHandler.h"
2019-02-12 18:38:43 -05:00
# include "Misc/Paths.h"
2019-02-05 18:09:08 -05:00
void FApplePlatformBackgroundHttp : : Initialize ( )
{
const FString DefaultIdentifier = TEXT ( " com.epicgames.backgroundhttp " ) ;
ensureAlwaysMsgf ( FBackgroundURLSessionHandler : : InitBackgroundSession ( DefaultIdentifier ) , TEXT ( " Failure to create a background download session with identifier %s " ) , * DefaultIdentifier ) ;
}
void FApplePlatformBackgroundHttp : : Shutdown ( )
{
FBackgroundURLSessionHandler : : ShutdownBackgroundSession ( ) ;
}
FBackgroundHttpManagerPtr FApplePlatformBackgroundHttp : : CreatePlatformBackgroundHttpManager ( )
{
return MakeShared < FApplePlatformBackgroundHttpManager , ESPMode : : ThreadSafe > ( ) ;
}
FBackgroundHttpRequestPtr FApplePlatformBackgroundHttp : : ConstructBackgroundRequest ( )
{
return MakeShared < FApplePlatformBackgroundHttpRequest , ESPMode : : ThreadSafe > ( ) ;
}
FBackgroundHttpResponsePtr FApplePlatformBackgroundHttp : : ConstructBackgroundResponse ( int32 ResponseCode , const FString & TempFilePath )
{
return MakeShared < FApplePlatformBackgroundHttpResponse , ESPMode : : ThreadSafe > ( ResponseCode , TempFilePath ) ;
}