Go through this link. This gives the idea for making plugins for iOS. If any doubt, ask.
A practical example for plugin
1) Make a C# file called AppControllerBinding.cs in the plugins folder in Unity and add the code as followed:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
// All Objective-C exposed methods should be bound here
public class AppControllerBinding
{
[DllImport("__Internal")]
private static extern void _MyFunction(string myName);
public static void MyFunction(string MyNameIN)
{
// Call plugin only when running on real device
if( Application.platform == RuntimePlatform.IPhonePlayer )
_MyFunction(MyNameIN);
}
}
2) Add the MyFunction() function to the bottom on the AppController.mm file inside Xcode as follows (after the @end statement):
extern "C"
{
void _MyFunction(const char* MyName)
{
NSString* s = [NSString stringWithUTF8String: MyName];
[Self logName:s]; //<-----logName is method which takes string parameter
printf_console("_MyFunction() called in Appcontroller.mm in Xcode.\n");
}
}
3) When you want to use the logName function of AppController.mm inside Unity just make a call like this:
AppControllerBinding.MyFunction("Nick");