The idea is simple, we store the functions in a matrix and pass a unique identifier in the messageMetadata value to Nitoku main app. On the File manager block, for the deleteFIle method, you can see how we have defined the callbackAfterDeleteFileId value :
var callbackAfterDeleteFileId = uniqueID(); and then pass that value to the main Nitoku app on the message.
When then the program receives the response from Nitoku main app we use the unique identifier to run the associated function.
The delete method itself becomes straight forward with to arguments, the uri of the file to be deleted and the success callback function that we want the method to execute after the operation has been successful.