MoEngageFolderDataHandler
public struct MoEngageFolderDataHandler
-
nitialization function for the
MoEngageFileDataHandler1
Declaration
Swift
public init(sdkInstance: MoEngageSDKInstance, folderName: String, isFromExtension: Bool = false)
Parameters
sdkInstance
An instance
MoEngageSDKInstance
folderName
A
String
representing the folder nameisFromExtension
A
Bool
representing whether it is from extension or not. Default value istrue
-
Fetches data from a file in a specified directory.
Throws
An error of type MoEngageDataError.fileNotFound if the file does not exist or could not be located.Declaration
Swift
public func getData(file: String) throws -> Data
Parameters
file
The file name from where data is to be fetched
Return Value
The data fetched from file as an instance of Data
-
Saves response data to a certain file.
Declaration
Swift
public func saveData(response: [String : Any], fileName: String)
Parameters
response
The data to be written to the file.
fileName
The name of the file where the data is to be saved.
-
checks if a certain path exists.
Declaration
Swift
public func doesPathExist(for file: String) -> Bool
Parameters
file
The file path to be checked.
Return Value
A Bool indicating whether the path exists.
-
Ggets the folder path the .
Declaration
Swift
public func getFolderPath() -> String?
Return Value
A String? representing the folder path.
-
Gets the File Path.
Declaration
Swift
public func getFilePath(for file: String) -> String?
Parameters
file
A
String
that represents the file.Return Value
A String? representing the file path.