Sunday, September 21, 2014

Including XMPP framework in a sample app

In the iPhone XMPP sample app included in the framework, the XMPP group contains the files and folders that can be easily copied to another project. The folders include Authentication, Categories, Core, Extensions, Utilities, Vendor. Also, this is having XMPPFrameworks.h file which is basically includes other framework files and header files. To integrate the XMPP framework into the sample app, can follow the steps below 

Copy the above folders into XMPP folder in the XMPP Sample app folder. Now drag and drop the XMPP folder to the sample app project to create XMPP folder group. 
Application should include the references libraries such as CFNetwork,  CoreData, SystemConfiguration, CoreLocation, Security.

Rest of the job is to implement the XMPP core and other methods and implement the callbacks as necessary. The sample app project files that demonstrate the integration can be found here. To run the sample app, just follow the below steps 

Sample App project can be downloaded from: 
https://drive.google.com/file/d/0B0ZgwdHsnw1bYVh2c1lvNmxucW8/edit?usp=sharing

1. Extract and launch the XMPPSample.xcodeproj file 
2. Open AppDelegate.h and change the JABBER_USER_NAME & JABBER_PASSWORD to valid jabber service user name and password. For e.g. gtalk id and password. 
3. Run the sample => wait for 2-3 seconds, it brings up the roster with the images and the presence status categorised in UITableView sections 

A screenshot of the running sample with my gtalk id can be seen at: 
https://drive.google.com/file/d/0B0ZgwdHsnw1bZU5ITVdxUjUzSjA/edit?usp=sharing

Note: The sample is very basic and may not show any errors if the jabber user name or password is wrong. The sample is inspired by the iPhoneXMPP sample available in the XMPPFramework project. A new sample is created just to demonstrate how easy it is to integrate into a new project. As it turned out, it is pretty easy. 

References: 

No comments:

Post a Comment