How can I implement auto join for XMPP room in iOS - ios

I want to do Auto Join room in XMPP group chat.
I have all of group created from back end Server, first time i join the room but when i disconnect from XMPP (out of the app) and back inside app and re-connect xmpp, I again need to join the room.
In side app one user already available in multiple room so not possible to Join again n again in the room . Please help..
Thanks in Advance!

I think you have to show this link : https://xmpp.org/extensions/xep-0048.html .
Here you can find the solution of Auto join and room storage.

There is No way for , reEnter to your rooms Automatically.
you should make a loop in your group list ( rooms ) and Enter to each of them.
i recommend to do it by operationQueue.

Related

Create One to One Chat in Sendbird IOS

I was trying to create a chat application using SendBirdSDK. But I couldn't find any methods in the documentation to start chat with a user. I downloaded the sample project and checked it, but it contains group channels and open channels only.
Is there any such methods to create 1 to 1 messages or should I need to create a groupchat with single user ID only?
Any help will be apreciated
According to the documentation,
A Group Channel is a private chat. A user may join the chat only through an invitation by another user who is already a member of the chatroom. A Group Channel can consist of one to hundreds of members. Creating a channel with two members allows 1-to-1 messaging.
So you just need to create a Group Channel with two User IDs in order it to be a 1-to-1 chat. Also, you should enable the Distinct property, because also according to the docs:
Consequently, we recommend that you enable the Distinct property in 1-to-1 messaging channels in order to reuse the same channel when a user chooses to directly message a friend. If the property is disabled, the user will create a new channel even if they have had previous conversations with the friend, and therefore will not be able to see or access previously sent messages or data.
Reference: https://docs.sendbird.com/ios#group_channel_3_creating_a_group_channel
I am not sure but in group channel they provide 1-on-1 messaging. But for that you need to create a group with other userID
You can use the reference code from here:
https://sendbird.gitbooks.io/how-to-build-an-ios-messaging-app/content/en/implement_1-on-1_messaging.html

MUCLight Offline message fetch XMPP

Have any one implemented MUC Light that is Beta released in MongooseIM Chat server for XMPP.
How to fetch fetch following messages when
1) User are offline while they were added as participants of group.
2) Users who are members byt offline and get messages on the muc light group.
I have achieved mod_zero push to trigger the offline message to Users, Also able to store the message in mam_muc_message table in my chat server MySQL database. But how the client will fetch these messages and also be notified with all messages.
Any guidance is much appreciated.
http://mongooseim.readthedocs.io/en/latest/open-extensions/muc_light/
Thanks for suggestion and comments here is how i managed with small limitation.
When user is offline while he was added by some group by others, he wont get this create group stanza as muc-light suggest.
When he come online , there have to be someone atleast who send a group message
When he gets this message I fetch the group configuration and create a new group first and keep this message as pending to process.
Once group created then i link this pending message to this group.
Then I call the MUC light MAM messages as given in 6.2 XEP-0313 Message Archive Management
Then I fetch all the previous messages and add in my database and display on the screen.
The only limitation that is there is after he come online he can't go to server and ask ALL muc-light messages, some how coz the server is not available is thrown if I ask for traditional MAM process to give messages for muclight.****.com group ID so I use as they asked to fetch in above link.
Hope MUC Light Beta is improving ahead more taking this into consideration.

Whats the best way to handle realtime client-server communication for ios?

Hello there i am working on an education focues application that works like written below:
1- "Teacher" user has a class, with "Student" users listed in main screen
2- Teacher starts an exam
3- Student users will get a notification that the exam has been started.
4- Teacher will observe the students actions in realtime (i.e when u student answers a question, teacher will automatically see which question is answered and if it is correct or wrong)
The application will be an iPad application and serverside will use (sadly) Microsoft WCF.
Here are things that i thought about things that i could do:
Establishing a socket connection with teacher and students via server like a irc chatroom on background
Using push notifications to receive student actions (somehow without showing any "push" notification
(Worst case scenario), teacher's device will periodically send requests about student's exam status
What do you think? What is the best way to do?
Thanks for helping.
Take a look on websocket.
https://github.com/square/SocketRocket
Maybe this lib is your friend, but i can't help you on server side job.

TokBox number of users in a room or session

I am new to using TokBox with my Rails app. I have created my "rooms" and a user can create a "room" and other users can join the room and video conference together Marvelous! But how do I know how many users are in a room and which users they are? I would like to display their information eventually but initially I just need to know how to see who is in the room on pageload. Any experienced TokBox devs out there?
There isn't any way to see who is in the room on pageload. Once you are connected to a session, you will get a connectionCreated event for every person in the room. To get the number of users in the room, just have a counter that increments for each connectionCreated event that gets triggered.

XMPP Get number of room members without connecting to a room

I have: ios app;
Server: openfire;
Framework: xmppframework from Robby Hanson.
The logic of the app is when user has logged in, the app will push him into a random room which has the fewest number of members.
The app successfully gets a list of all rooms on start from the server.
But I need to know which of these rooms have an empty place for a user!
There is a method called "fetchmemberslist", but it only returns you a list of members of a room when you are connected to that room.
I need something that will do the same without connecting to a room.
Think if I have 1000 rooms. Using this method the app needs to connect to every room, set delegate, activate, wait for IQ, remove delegate, deactivate and at the and go thru an array to find one with the fewest members.
Isn't it too much to do?
I have dig over the whole internet and everything leads to getting a member list when you are connected to a room.
Is there a way of doing this without connecting a room.
Many thanks in advance!
1) fetchMemberList: queries room members, not list of people who are present in room now. Are you really want members, not online users count? Anyway, if you are room admin, this query works without joining room.
2) If you want to query online users, you should use different query - see http://xmpp.org/extensions/xep-0045.html#disco-roomitems
3) Also, no one can forbid you to implement room members/onlines count on the server side and create custom query like <iq id='123' type='get'><freeroom xmlns='my:freeroom:query' /></iq> with response of room JID like <iq id='123' type='result'><freeroom xmlns='my:freeroom:query'><jid>roomname#conference.example.com</jid></freeroom></iq> where roomname was found by server itself.

Resources