Type Function Return value none Revision 2017.3060 Keywords iCloud, sync, storage, document, docConflictData See also iCloud.docConflicts() iCloudDocEvent event.conflicts iCloud.*
Retrieves contents of a document conflict gathered from iCloud.docConflicts() and invokes the onComplete
listener function with an iCloudDocEvent upon completion.
iCloud.docConflictData( params )
Table. Table containing
Valid keys for the params
table include:
conflict
— Required; the dataHandle
of a conflict gathered from iCloud.docConflicts().
onComplete
— Required listener function to be invoked with an iCloudDocEvent.
containerId
— Optional string value indicating a specific iCloud Container to be used for document storage. Do not pass this parameter if you have only one iCloud Container associated with your app.
local function printConflictData( event ) print( "Conflict contents: " .. event.contents ) end local function docListener( event ) if event.conflicts then for i = 1,#event.conflicts do print( "Conflict origin: " .. event.conflicts[i].origin ) print( "Conflict time: " .. event.conflicts[i].time ) iCloud.docConflictData( { conflict = event.conflicts[i].dataHandle, onComplete = printConflictData } ) end end end iCloud.docConflicts( { filename = "test.txt", onComplete = docListener } )