Add friends to the XMPP iOS client (3)Here we record the process of adding friends. Although there are examples on the Internet, they are not very comprehensive, and one of them is not given.
Initialize the XMPPRoster class. I have been searching for the initialization settings of this class for a long time. Not much. Paste the code below.
Initialize the XMPPRoster object Declaration
@ Interface XMPPModel ()
@ Property (nonatomic, strong) XMPPS
The basic idea of sending pictures and audio files is:First convert the picture into a binary file, then encode the binary file base64 and encode it into a string. A child node is added within the message to be sent, and the node's stringvalue (the value of the node) sets the encoded string. Then after the message is taken out of the message file, through the MessageType first judge is not picture information, if the picture information first through their own previously set node name, the child
=Self.friends.text; //Get friend nameAppdelegate *Delegate=[uiapplication Sharedapplication].Delegate; Xmppjid* jid=[Xmppjid Jidwithstring:name]; if([Delegate. rosterstorage Userexistswithjid:jid Xmppstream:Delegate. Stream]) {NSLog (@"friends already exist."); }Else{ //Add Friends[Delegate. Roster Subscribepresencetouser:jid]; }}To learn more about the small partners, you can click to view the source code , run the test yourself.Inquiries or technical exchanges, please join the official
1. Identity Authentication
The standard XMPP verification method is SASL. The simple method of Jabber is to send the IQ package, and the xmlns is jabber: IQ: Auth. In reality, many servers only support the traditional jabber method instead of SASL. For example, I chose jive messenger. The general process of identity authentication is to first use the IQ package to check whether the user exists, and then send the user name and password in the past.
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 re
Real solution to File Transfer Using XMPP Asmack
In the process of using Asmack, file transmission is a huge obstacle that hinders me from moving forward. Baidu and Google cannot be resolved. By accident, I suddenly looked back and solved this problem. Therefore, set this post to record for yourself, and hope to help the Later users. I hope that I can make the same instant communication and send various rich media. Next I will see how to implement fil
XMPP Client library Smack development of 4.0.6 version fiveChszs, reprint need to indicate. Blog home:Http://blog.csdn.net/chszsIv. using Chat message communicationSending and receiving messages back and forth is the core function of instant Messaging. Although a single message is sent and received in the form of a packet, it is usually treated as a message string for chatting, using the Org.jivesoftware.smack.Chat class.1. Chat classOne chat chat cre
I record technology video address: https://edu.csdn.net/lecturer/1899 Welcome to watch.
One, what is the socket socket essentially provides the endpoint of the process communication. Before a process communicates, both parties must first create an endpoint, otherwise there is no way to establish a connection and communicate with each other. Just like before the phone call, both sides must each have a telephone. In the intranet, each socket is described in a half correlation: (protocol, local add
> Transfer from others and forget
========================================================== ======================================Actively send information to a user------------------------------------Xmppconnection. debug_enabled = true;// Set the server addressXmppconnection conn = new xmppconnection ("127.0.0.1 ");Conn. Connect ();// Enter the account and password to log onConn. login ("test2@127.0.0.1", "123456 ");// Create a dialog with test1 a
Oracle to the lib directory.If the connection is successful, openfire will automatically initialize the database and complete the database configuration.* There are SQL scripts for related databases under resources \ Database
Step 4: users and groupsOpenfire user/group supportDatabaseLDAPClearspace
Step 5 Administrator PasswordSet the Administrator's email address and password
After completing the preceding operations, openfire installation is complete.
Open http: // 127.0.0.1: 9090/agai
1. Invitation:
In a simple sentence, the jid of the invitee should be input during the invitation. The invitation information can be blank.
MUC. Invite (userjid, "let's chat ");
At the same time, we need to know what happened. When this statement is executed, a message will be sent to the server, as shown below:
2. Invited
If you are invited, you can enable a listener. If you want to enter the room, you can skip this step. If you have an invitation
None "-- the user does not have a subscribe to the contact's presence information, and the contact does not have a subscribe to the user's presence Information
"To" -- the user has a subscribe to the contact's presence information, but the contact does not have a subscribe to the user's presence Information
"From" -- the contact has a subscribe to the user's presence information, but the user does not have a subscribe to the contact's presence Information
"Both" -- both the user and the con
Here's a record of the process I'm configuring XMPPFirst download xmpp:https://github.com/robbiehanson/xmppframework/Enter the following file into the process:Adding a dependency frameworkTo add a dependent path to the XML framework:The configuration is done. Here's how to log in. Of course, the server to make a good first, if not good to see the previous article.Login code:@interface Xmppmodel () -(BOOL) connect{ [self setupstream]; Here in ord
Recently, I need to develop some projects related to instant messaging, and spent a few days collecting information about instant messaging.
Finally, openfire is selected as the server, and asmack is used as the android implementation.
1. Only send and not receive
If you follow the instructions written on the API, add the listener directly after the chat between new and a user.
Write as follows to solve the problem.
[Java]
View plaincopyprint?
Cha
I. Preparations
Procedure: Database> Server> Client
First configure the database, because the server needs to connect to the database at startup, then configure the server, and finally configure the client2. Configure the database
Select MySQL database
1. Find the MySQL database installation package with the. DMG suffix.
2. Open the installation package an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.