Type Function Library native.* Return value Boolean and String Revision Release 2024.3703 Keywords sync, icloud, backup, documents See also native.setSync()
Gets the iCloud automatic backup settings for files in the system.DocumentsDirectory
and system.ApplicationSupportDirectory
on macOS and iOS systems.
The iCloud backup is true
by default and must be set false
with the native.setSync() API to disable automatic backup of files to iCloud.
This function returns up to two values:
This function is for macOS and iOS platforms only.
native.getSync( filename, params )
String. Name of file (including path).
Table. Table with the structure { key = "iCloudBackup" }
.
-- Assumes that a file named 'SavedData.txt' is in 'system.DocumentsDirectory' local results, errStr = native.getSync( "SavedData.dat", { key = "iCloudBackup" } )
-- Assumes that a file named 'SavedData.txt' is in a 'data' subdirectory of 'system.DocumentsDirectory' local results, errStr = native.getSync( "data/SavedData.dat", { key = "iCloudBackup" } )