From 7ec186df2d9bce12c8eda6a254dae067e367fdd9 Mon Sep 17 00:00:00 2001 From: Desu Sai Venkat Date: Thu, 16 Nov 2023 18:09:22 +0530 Subject: [PATCH] fix: fixed sqlite db path on the tvos platforms --- Sources/Classes/Utility/RSUtils.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Classes/Utility/RSUtils.swift b/Sources/Classes/Utility/RSUtils.swift index 54ee94bb..59526737 100644 --- a/Sources/Classes/Utility/RSUtils.swift +++ b/Sources/Classes/Utility/RSUtils.swift @@ -24,7 +24,11 @@ struct RSUtils { } static func getDBPath() -> String { +#if os(tvOS) + let urlDirectory = FileManager.default.urls(for: FileManager.SearchPathDirectory.cachesDirectory, in: FileManager.SearchPathDomainMask.userDomainMask)[0] +#else let urlDirectory = FileManager.default.urls(for: FileManager.SearchPathDirectory.libraryDirectory, in: FileManager.SearchPathDomainMask.userDomainMask)[0] +#endif let fileUrl = urlDirectory.appendingPathComponent("rl_persistence.sqlite") return fileUrl.path }