Create a native plug-in for iOS and import it into your Unity project.
For each native function you want to call, define an extern method in the C# file as follows:
[DllImport ("__Internal")]
private static extern float FooPluginFunction();
If using C++ (.cpp) or Objective-C++ (.mm) to implement your plug-in, declare functions with C linkage to avoid issues with name mangling:
extern "C" {
float FooPluginFunction();
}
Plug-ins written in C or Objective-C don’t need this, because these languages don’t use name mangling.
Add your native code source files to the Unity Project’s Assets Folder.
To configure plug-in settings for iOS: