For this to work iFreeRDP must have some kind of plug-in architecture allowing you to run custom code and open a virtual channel (this seems unlikely given Apple's strict policies on sandboxing, but I may be wrong).
If this is possible, you'd want to write a plug in as in the following article (assuming iFreeRDP uses the same interfaces for plug ins as the traditional Terminal Service Client on Windows): How to Write a Terminal Services Add-in in Pure C#
Although the article uses C#, the key functions from the Terminal Services API are used which are where the complexity lies.