Realtime Chat Room Application on iOS

We have developed a sample iOS Chat Room Application using AppWarp (realtime multiplayer cloud engine). Since AppWarp is a cross-platform solution, developers can build similar applications on other platforms as well like Android, Windows Phone, J2ME etc. Chat rooms are useful in making your apps more engaging and social. For example iDubba & iCouch have a similar use case i.e. user could chat with his friends/family members about a TV show while watching it.

This sample also serves a guide for joining and subscribing AppWarp rooms.

Steps to follow:

Step1: Connect

1
2
3
4
5
- (void) connectWithUser:(NSString *)_aUserName {
          kFunctionLog;
          WarpClient *wrCl = [WarpClient getInstance];
          [wrCl connectWithUserName:_aUserName];
}

1 Realtime Chat Room Application on iOS

Step2: Get the Chat Room Information

1
2
3
4
- (void) getAllRoomsInfo {
    WarpClient *wrCl = [WarpClient getInstance];
    [wrCl getAllRooms];
}

2 Realtime Chat Room Application on iOS

Step3: Select a Room

1
2
3
4
5
6
7
// Segue called for selected room
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"ChatViewSegue"]) {
        ChatViewController *chatView = (ChatViewController *)[segue destinationViewController];
        chatView.selectedRoomID = [_roomIDArray objectAtIndex:[[rsListTableView indexPathForSelectedRow] row]];
    }
}

4 Realtime Chat Room Application on iOS
Now, the chat room is available.

Step:4 Join and Subscribe to the Room

1
2
3
4
5
- (void) joinRoomForSelectedID {
    WarpClient *wrCl = [WarpClient getInstance];
    [wrCl joinRoom:_selectedRoomID];
    [wrCl subscribeRoom:_selectedRoomID];
}

Step:5 Send the Chat text

1
2
3
4
- (void) sendChatForText:(NSString *)_text {
    WarpClient *wrCl = [WarpClient getInstance];
    [wrCl sendChat:_text];
}

7 Realtime Chat Room Application on iOS
Step:5 Disconnect from the current Room

1
2
3
WarpClient *wrCl = [WarpClient getInstance];
    [wrCl leaveRoom:_selectedRoomID];
    [wrCl unsubscribeRoom:_selectedRoomID];

10 Realtime Chat Room Application on iOS
Follow the same process to join another room of your choice. Please find the sample code here and IOS AppWarp API Guide here.

twitter Realtime Chat Room Application on iOSfacebook Realtime Chat Room Application on iOSgoogle Realtime Chat Room Application on iOSlinkedin Realtime Chat Room Application on iOSpinterest Realtime Chat Room Application on iOSreddit Realtime Chat Room Application on iOSstumbleupon Realtime Chat Room Application on iOStumblr Realtime Chat Room Application on iOS
Follow Us
Facebook twitter linkedin google

Develop Realtime Chat Room application on Android

We’ve developed a demo Android chat room application using AppWarp which is our realtime multiplayer network cloud engine. This chat room application also illustrates the use of our match-making apis which we introduced in our last release. Specifically it highlights the benefits in terms of ease of use and time saving for developers by delegating the work of searching for the desired room to our cloud server.

View Source Code

Since AppWarp is cross-platform, one can easily build similar applications for iPhone, Windows Phone, J2ME based phones and make them interact with each other in realtime.

Chat is also a useful feature to add to your games. This helps in keeping the users engaged and also allows you to make the game more social.

Watch our video tutorial on how to download, build and get it running.

If you are modifying the topics of the room, then you need to modify the contents of the strings.xml file as well accordingly. Edit the following code snippet in this file as required.

<string-array name="topic_arrays">
        <item>sports</item>
        <item>entertainment</item>
        <item>education</item>
        <item>books</item>
        <item>science</item>
</string-array>
login github account Develop Realtime Chat Room application on Android
twitter Develop Realtime Chat Room application on Androidfacebook Develop Realtime Chat Room application on Androidgoogle Develop Realtime Chat Room application on Androidlinkedin Develop Realtime Chat Room application on Androidpinterest Develop Realtime Chat Room application on Androidreddit Develop Realtime Chat Room application on Androidstumbleupon Develop Realtime Chat Room application on Androidtumblr Develop Realtime Chat Room application on Android
Follow Us
Facebook twitter linkedin google