Skip to content

A wrapper for OpenTok iOS SDK to easily integrate Text Chat feature into your applications.

Notifications You must be signed in to change notification settings

suyati/OpenTok-TextChat-iOS

Repository files navigation

OpenTok-TextChat-iOS

A wrapper for OpenTok iOS SDK to easily integrate Text Chat feature into your applications.

#Setup

##Running the Sample App

KAPI_KEY, 
KSESSION_ID, 
KSESSION_TOKEN
  • Run the application.

##Integration with existing project

  • Add SYOpenTokClient.h and SYOpenTokClient.m into your project.

  • Import .h into your viewController.

  • Create an object and intialize it using the following:

@interface ViewController ()
{
    SYOpenTokClient *client;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.chatArray = [[NSMutableArray alloc] init];
    client = [[SYOpenTokClient alloc] initWithKey:KAPI_KEY
                                        sessionId:KSESSION_ID
                                            token:KSESSION_TOKEN 
                                         delegate:self];

}
  • To send a message
[client sendMessage:message withSignalType:@"chat" toConnection:nil];

params: 

message: The data to send

signalType: The type of the signal 

connection: A destination OTConnection object. (Use this to send a message to specific user).
  • Implement the delegate method
- (void)chatSession:(OTSession*)session
 receivedSignalType:(NSString*)type
     fromConnection:(OTConnection*)connection
         withString:(NSString*)string
           isAuthor:(BOOL)isAuthor;
  • When message is send or received, this delegate method will be called. You can check the author flag to identify the creator of the message.

#Authors and Contributors

OpenTok-TextChat-iOS is developed by Suyati Technologies. It is written and maintained by their iOS Development team.

Author:

  • Rijo George (@rgeorgesuyati)

#Support or Contact

Have Suggestions? Want to give us something to do? Contact us at : [email protected]

About

A wrapper for OpenTok iOS SDK to easily integrate Text Chat feature into your applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published