OpenTok Text Chat Accelerator Pack enables text messages between mobile or browser-based devices.

Overview

Text Chat Accelerator Pack iOS

Build Status Version Status license MIT Platform PRs Welcome codebeat badge

Tokbox is now known as Vonage

This project is deprecated

The OpenTok Text Chat Accelerator Pack for iOS project is now a part of Accelerator Core iOS

The Text Chat Accelerator Pack provides functionality you can add to your OpenTok applications that enables users to exchange text messages between mobile or browser-based devices.

Text Chat Accelerator Pack Examples

default custom

Configure, build and run the sample app

  1. Get values for API Key, Session ID, and Token. See Obtaining OpenTok Credentials for important information.

  2. Install CocoaPods as described in CocoaPods Getting Started. If you are only interested in the core part without UI component, you can use this pod 'OTTextChatAccelerator/Core'

  3. In Terminal, cd to your project directory and type pod install.

  4. Reopen your project in Xcode using the new *.xcworkspace file.

  5. Replace the following empty strings with the corresponding API Key, Session ID, and Token values:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Override point for customization after application launch.
        sharedSession = [[OTAcceleratorSession alloc] initWithOpenTokApiKey:@"apikey" sessionId:@"sessionid" token:@"token"];
        return YES;
    }
  6. Use Xcode to build and run the app on an iOS simulator or device.

  7. For testing text chat, we include a simple web app to make it easier: Browser-Demo-TextChat. Simply open it and replace the corresponding API Key, Session ID, and Token values. Then save and load it to the browser.

  8. You might want to run on other platforms:

Accelerator Textchat Javascript
Accelerator Textchat Android

Sample Codes

  • Passing the session

    - (OTAcceleratorSession *)sessionOfOTOneToOneCommunicator:(OTOneToOneCommunicator *)oneToOneCommunicator {
        return <#OTAcceleratorSession#>;
    }
  • Start signaling text chat data

    // we assume self owns a table tableView
    [self.textChat connectWithHandler:^(OTTextChatConnectionEventSignal signal, OTConnection *connection, NSError *error) {
        if (signal == OTTextChatConnectionEventSignalDidConnect) {
            NSLog(@"Text Chat starts");
        }
        else if (signal == OTTextChatConnectionEventSignalDidDisconnect) {
            NSLog(@"Text Chat stops");
        }
    } messageHandler:^(OTTextChatMessageEventSignal signal, OTTextMessage *message, NSError *error) {
        if (signal == OTTextChatMessageEventSignalDidSendMessage || signal == OTTextChatMessageEventSignalDidReceiveMessage) {
            if (!error) {
                [weakSelf.textMessages addObject:message];
                [weakSelf.tableView reloadData];
            }
        }
    }];
  • Stop signaling text chat data

    [self.textchat disconnect];

Obtaining OpenTok Credentials

To use OpenTok's framework you need a Session ID, Token, and API Key you can get these values at the OpenTok Developer Dashboard . For production deployment, you must generate the Session ID and Token values using one of the OpenTok Server SDKs.

JSON Requirements for Text Chat Signaling

The JSON used when using the OpenTok signaling API with the OpenTok Text Chat component describes the information used when submitting a chat message. This information includes the date, chat message text, sender alias, and sender ID. The JSON is formatted as shown in this example:

// var type = "text-chat"
{
    "sentOn" : 1462396461923.305,
    "text" : "Hi",
    "sender" : {
        "alias" : "Tokboxer",
        "id" : "16FEB40D-C09B-4491-A983-44677B7EBB3E"
    }
}

This formatted JSON is converted to a string, which is submitted to the OpenTok signaling API. For more information, see:

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Further Reading

Comments
  • Can't change session after first start

    Can't change session after first start

    Hi opentok team,

    Is there any way to change the session id after first start ?

    I don't understand the choice of using a singleton for OTAcceleratorSession.m:

        if (self = [super initWithApiKey:apiKey sessionId:sessionId delegate:self]) {
            _internalApiKey = apiKey;
            _internalSessionId = sessionId;
            _internalToken = token;
            
            _delegates = [[NSMutableSet alloc] init];
            _inactiveDelegate = [[NSMutableSet alloc] init];
            _publishers = [[NSMutableSet alloc] init];
            _subscribers = [[NSMutableSet alloc] init];
        }
    

    If I am not wrong, there is no solution to change the session id after the initialization of the singleton and the user has to kill the app to change the session id.

    Any solution for this ?

    opened by VincentCtr 2
  • Updating acceleratorCore version

    Updating acceleratorCore version

    Pull request checklist

    • [ ] All tests pass. Demo project builds and runs.
    • [ ] I have resolved any merge conflicts. Confirmation: ____

    This fixes issue #___.

    What's in this pull request?

    ...

    opened by marinaserranomontes 1
  • Fix Badges position

    Fix Badges position

    Pull request checklist

    • [ ] All tests pass. Demo project builds and runs.
    • [ ] I have resolved any merge conflicts. Confirmation: ____

    This fixes issue #___.

    What's in this pull request?

    Fix Badges position Add GitHub release badge

    opened by PanoramicRum 1
  • Release 2.0.1

    Release 2.0.1

    Pull request checklist

    • [x] All tests pass. Demo project builds and runs.
    • [x] I have resolved any merge conflicts.

    Release notes

    Update OTAcceleratorCore to 2.0.1

    opened by abdulajet 0
  • further linting errors

    further linting errors

    Pull request checklist

    • [x] All tests pass. Demo project builds and runs.
    • [x] I have resolved any merge conflicts

    What's in this pull request?

    Continues on from #18

    opened by abdulajet 0
  • fix linting error

    fix linting error

    Pull request checklist

    • [x] All tests pass. Demo project builds and runs.
    • [x] I have resolved any merge conflicts. Confirmation: ____

    What's in this pull request?

    Ran into a linting error when trying to release a new version see here for more info: https://github.com/CocoaPods/CocoaPods/issues/7433

    opened by abdulajet 0
  • 2.0.0 release

    2.0.0 release

    Pull request checklist

    • [x] All tests pass. Demo project builds and runs.
    • [x] I have resolved any merge conflicts.

    This fixes issue https://nexmoinc.atlassian.net/browse/DEVX-3579

    What's in this pull request?

    Updating OTAcceleratorCore to version 2.0.0 Fixed input field layout issue Missing background colour for modal views Updated minimum iOS version to iOS 11 Dark mode fixes

    opened by abdulajet 0
  • Updating repo to adhere to Vonage repo-standards

    Updating repo to adhere to Vonage repo-standards

    Includes:

    • Updated README.md to include branding change image
    • Updated README.md to define additional support options
    • Added CODE_OF_CONDUCT.md
    • Added CONTRIBUTING.md
    opened by MichaelJolley 0
  • Update 2 16

    Update 2 16

    Pull request checklist

    • [ ] All tests pass. Demo project builds and runs.
    • [ ] I have resolved any merge conflicts. Confirmation: ____

    This fixes issue #___.

    What's in this pull request?

    • Update to latest accelerator core and iOS SDK (v2.16.1)
    • Generate and add CocoaPods lock file to repo
    • Update CocoaPods and spec file to use latest iOS accelerator core
    • Update minimum deployment targets to 10.0

    ...

    opened by jtiet 0
  • 1.0.3 Release

    1.0.3 Release

    Pull request checklist

    • [x] All tests pass. Demo project builds and runs.
    • [x] I have resolved any merge conflicts. Confirmation: ____

    This fixes issue #___.

    What's in this pull request?

    ...

    opened by Lucashuang0802 0
  • Fix CHANGELOG typo

    Fix CHANGELOG typo

    • Fix an error in the CHANGELOG HEADING.

    Pull request checklist

    • [ ] All tests pass. Demo project builds and runs.
    • [ ] I have resolved any merge conflicts. Confirmation: ____

    This fixes issue #___.

    What's in this pull request?

    ...

    docs 
    opened by PanoramicRum 0
Releases(2.0.1)
Chat SDK iOS - Open Source Mobile Messenger

Chat SDK Open Source Messaging framework for iOS Chat SDK is a fully featured open source instant messaging framework for iOS. Chat SDK is fully featu

Chat SDK 879 Jan 6, 2023
A smooth, responsive and flexible messages UI library for iOS.

AsyncMessagesViewController A smooth, responsive and flexible messages UI library for iOS apps. Built on top of the awesome Texture (formerly AsyncDis

Huy Nguyen 300 Oct 10, 2022
A lightweight framework to build chat applications, made in Swift

Chatto Chatto is a Swift lightweight framework to build chat applications. It's been designed to be extensible and performant. Along with Chatto there

Badoo Tech 4.4k Dec 19, 2022
Open source, native iOS Messenger, with realtime chat conversations (full offline support).

OVERVIEW This is a native iOS Messenger app, with realtime chat conversations (full offline support). NEW FEATURES Passcode support GraphQL server sup

Related Code 4.5k Jan 9, 2023
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift

Real time Swift iOS Chat with Firebase - Messenger Clone This is an extremely simple chat app source code of an iOS Swift Chat app. It leverages Messa

Instamobile 621 Jan 6, 2023
Use Swift to pack ambiguous image that display differently on Apple and Other devices

Aibmoe Use Swift to pack ambiguous image that display differently on Apple and O

Lakr Aream 2 Feb 3, 2022
The SwiftUI Messages Clone consists of layout and composition clones of the iOS Messages app.

The SwiftUI Messages Clone consists of layout and composition clones of the iOS Messages app. It has Messages-like bubble and screen effects, reactions, and animations, all created with SwiftUI.

Stream 20 Dec 24, 2022
Syntax sugar of OpenTok iOS SDK with Audio/Video communication including screen sharing

Accelerator Core iOS The Accelerator Core is a solution to integrate audio/video communication to any iOS applications via OpenTok platform. Accelerat

OpenTok 30 Nov 8, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022
Mobile-ios-ml - SBB Mobile Machine Learning for iOS devices

ESTA library: Machine Learning for iOS This framework simplifies the integration

Swiss Federal Railways (SBB) 9 Jul 16, 2022
A solid language pack for Vim.

A collection of language packs for Vim. One to rule them all, one to find them, one to bring them all and in the darkness bind them. It won't affect y

Adam Stankiewicz 5.2k Jan 2, 2023
Scribe-iOS is a pack of iOS and iPadOS keyboards for language learners

Scribe-iOS is a pack of iOS and iPadOS keyboards for language learners. Features include translation (beta), verb conjugation and word annotation that give users the tools needed to communicate with confidence.

Scribe 47 Jan 4, 2023
Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

Switchboard - easy A/B testing for your mobile app What it does Switchboard is a simple way to remote control your mobile application even after you'v

Keepsafe 287 Nov 19, 2022
An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews

WebViewJavascriptBridge An iOS/OSX bridge for sending messages between Obj-C and JavaScript in WKWebViews, UIWebViews & WebViews. Migration Guide When

Marcus Westin 14.1k Jan 6, 2023
Swift toolkit for passing messages between iOS apps and extensions.

_________ ___ ___ _ _____ _________ ___ ___ / / \ \ / / |_| ( ___ \ \__ __/ \ \ / / / _____/ \ \ /\ /

Abdullah Selek 58 Nov 3, 2022
A chat simulator app that uses FireBase for Authentication and chat storage

Chat-App Description Flash chat is a chat simulator app that uses FireBase for Authentication and chat storage Tools Used - Swift (Programming Languag

Victor Alvarenga 0 Oct 14, 2021
TwilioChat_iOS - Twilio iOS SDK Implementaion Chat one-one Chat One-Many (Group)

TwilioChat_iOS - Twilio iOS SDK Implementaion Chat one-one Chat One-Many (Group) - Add Participant - Remove Participant Send Attachment Image Android - iOS Tested iOS - iOS Tested iOS - Android Tested React to Message, Delete a Message Read, Delivered, Sent Delete a Conversation Unread Messages Filter

Zeeshan Haider 2 May 23, 2022
Chat-App - GV Chat App is an iOS app built with Swift

GV Chat App - iOS Explore the docs » Report Bug · Request Feature About The Proj

Cyrus Dumbwani 0 Jan 25, 2022
Swift-Chat-Application - Swift Chat Application Using Firebase , messagekit

Swift-Chat-Application Using Firebase , messagekit

Metin ATALAY 7 Oct 9, 2022