- Home /
Implementing iOS Framework in Unity3D
Hello, I need help to implement this framework (Wahoo fitness API) http://api.wahoofitness.com/ in Unity.
The files they provide are some .h files and a Binary file (20 mb size) but no .mm files. I've seen that in order to integrate a framework in Unity, I need the .mm files, so I think that the only way is to build the project and then implement this framework in XCode. The problem is that I don't know how to communicate with those APIs inside of Unity.
I've seen that this method might work (with PostprocessBuildPlayer) https://github.com/guruguruman/AutomaticXCodeFrameworkLinker
I've tried to find a solution for days, so I would be very happy if any of you have any hints on how to do this :) I hope I've explained the problem good enough
thank you very much in advance for any suggestion.
What is the extension of the binary file? It's probably a library file of some kind, in which case you should be able to add that into your xcode project and call into it from objective-c.
Thank you Grahm for the comment, the binary file is a Java class (application/x-java). I know how to add this framework to XCode, but I don't know how to manage it through Unity. Any suggestions?
Answer by Sisso · Apr 29, 2013 at 04:59 PM
This statement is wrong ". I've seen that in order to integrate a framework in Unity, I need the .mm files". You build native plugins with C using "C-based call interface" (from ios ref).
Unity3d have some automations to make integration with IOS or java easy, like compile *.mm. But it is not mandatory to use.
The point is that I have just the header files (.h) and a Java class binary file. I don't have any C-like source file (e.g. .a, .m, .mm, .cpp) For this reason I think the only way is to integrate this framework from XCode, maybe referring to it previously, in the C# sources compiled by Unity.
Sorry I'm pretty noob in this field so it may be a very simple problem that I don't understand
What I understand is that if you already have the binaries compiled for the target platform, you only need to put it into /Plugins and create unityscrip/c# to wrap using DllImport.
But... I am not a expert too and never did It. Sorry, but I don't how to help more.
One more thing, you said that your library is in java? So, I understand that someone compile a java runtime language into ios binary code. Crap. (Related ref)
In this case, I think that you could consider your library as a simple C library.
Thank you Sisso for the suggestions, this plug in is written in Java, but it's designed to work on iOS. I've found out how to implement this framework in XCode, the only thing is that I don't know how to communicate with it through Unity
These links could help:
http://docs.unity3d.com/Documentation/$$anonymous$$anual/Plugins.html
http://docs.unity3d.com/Documentation/$$anonymous$$anual/PluginsForIOS.html
It really confused and scared at first time :P