Search code examples
iphonexamarin.ios.net-assemblyflurry

MonoTouch iPhone: Creating native assembly .NET wrappers


We are considering using an API from a 3rd party for the iPhone which was compiled in Xcode.

How do we create a wrapper for this native iOS library so that we can interop with it in Monotouch .NET

This is exactly what the Flurry.a wrapper did. We need to find out how to do it ourselves though. See Kevin Machanon's http://blog.kevfoo.com/index.php/2010/08/monotouch-flurry-analytics-bindings


Solution

  • On Kevin Machanon's GitHub repository you can take a look at the actual code. At first sight I believe the process implies the creation of an interface that mimics the native class you would like to use and decorate it with mapping attributes:

    • BaseType
    • Static
    • Export

    And pass the detailed native method call to the attributes parameters.