DLL file referencing iPhoneKeyboard fails to compile

Im trying to use the iPhoneKeyboard class from within my DLL and publish a mac project with it, unity stops and complains about some assembly not being able to load (which makes sense since Im referencing iPhone stuff).
When i remove all references to the iPhoneKeyboard class it builds just fine again.

Now, I really want one DLL file that works on all platforms, so is there anyway to have a dll file that references iPhone stuff and still compile on other platforms?
I can’t really #if UNITY_IPHONE || UNITY_ANDROID the code in my dll like I would normally do in my script inside unity.
Worst case scenario is to just put the iPhone specific code in a separate script file along with the dll; but I would prefer a complete dll with all classes included.

Thanks.

you can’t use a dll that works fine on all platforms that is using platform specific code. The code in it really has to be compliant to all platforms, platform specific code has to be present in unity so it can make use of the preprocessor directive.

Yes, that’s what i figured. Thanks for clarifying!