Since nobody have answered here I how I solved it:
- ASmack for Android in a new Android project in eclipse
- Build a custom wrapper for ASmack with the basic public methods for login,logout,send messages et.c.
- Extract as jar library.
- Import jar into Unity3D
- Use Unity3D's AndroidJNI methods to call the public methods of the jar
- Callbacks are set inside the Java-wrapper and call with "UnityPlayer.UnitySendMessage()" (classes.jar from Unity app package have to be imported into Eclipse project to compile)
A bit work is required and takes some time to debug and build, but it does work.
answered Sep 6 '12 at 12:00
Instead of all this manipulation with ASmack I recommend to use MatriX XMPP SDK. We are using this library for our Unity projects.
And it works on Win, Mac, iOS, Android without any special manipulation. We have only 1 problem with this lib - can't make it work on in WebPlayer
answered Jul 12 '15 at 10:28
posted on 2018-07-11 11:23 思月行云
阅读(205) 评论(1) 编辑 收藏 引用