Xmppframework
Github:https://github.com/robbiehanson/xmppframework
Get Source code
git clone https://github.com/robbiehanson/XMPPFramework.git
Checkout xmppframework an up-to-date branch
Add dependency
> Copy <xmppframework>/vendor/cocoalumberjack to the project root directory, add Files ..., select the Cocoalumberjack folder
> Same steps, copy Cocoaasyncsocket and Kissxml and add to Project
Cocoaasyncsocket dependent on cfnetwork.framework and security.framework, Link Binary with phases, Build Libraries, TARGETS Add to
Kissxml uses LIBXML2 to parse XML, so
First, we need to add the Link Binary with Libraries, TARGETS---Build phases Libxml2.dylib
Then, TARGETS, build Settings, other Linker Flags, add-lxml2,targets, build Settings, Header Search Path S add/usr/include/libxml2
> Copy <xmppframework>/vendor/libidn to Project root, add static library files Libidn.a and header files Idn-int.h and Stringprep.h
Add Xmppframework
Copy the authentication Categories Core and Utilities from the source directory to the project root directory and add to the project
In addition, you need to add the dynamic Connection library libresolv.dylib, TARGETS, Build phases, Link Binary with Libraries add
Add extension
You can add <xmppframework>/extensions extensions to your project according to your needs.
Problems you may encounter:
> "XMPPFramework.h" File not found
XMPPFramework.h content as follows, can be based on the actual use of the module for pruning:
#import "XMPP.h"//List the modules you ' re using here. #import "XMPPReconnect.h" #import "XMPPRoster.h" #import " XMPPRosterCoreDataStorage.h "#import" XMPPvCardTempModule.h "#import" XMPPvCardAvatarModule.h "#import" XMPPvCardCoreDataStorage.h "#import" XMPPCapabilities.h "#import" XMPPCapabilitiesCoreDataStorage.h "#import" XMPPMUC.h "#import" XMPPRoomCoreDataStorage.h "
There are also some problems, due to the fact that there are no dependent libraries required to add extension
Can be added at TARGETS-Build phases-Link Binary with Libraries
Coredata.framework systemconfiguration.framework Corelocation.framework
Other possible error-causing settings are as follows:
ARC Warning
Xmppframework uses arc, you get a lot of arc warnings if your project doesn't use Arc,build.
Don't ignore these warnings, it will cause your program to crash due to memory leak ...
Convert to Objective-c ARC, refactor, Edit, eliminate these warnings!
IOS XMPP: Adding Xmppframework and other Frameworks (iii)