All Projects → ccm-innovation → React Native Twilio Ip Messaging

ccm-innovation / React Native Twilio Ip Messaging

Licence: mit
React Native wrapper for the Twilio IP Messaging SDKs (Deprecated)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to React Native Twilio Ip Messaging

Twilio Contact Center
A contact center built on Twilio, supporting voice calls, web chat, callback, Facebook Messenger and SMS chat
Stars: ✭ 176 (+604%)
Mutual labels:  twilio, chat
Demo Twilio Backend Nodejs
A sample backend that demonstrates how to generate a Virgil JWT and Twilio token used for authentication with the Virgil and Twilio services
Stars: ✭ 128 (+412%)
Mutual labels:  twilio, chat
Vchat
💘🍦🙈Vchat — 从头到脚,撸一个社交聊天系统(vue + node + mongodb)
Stars: ✭ 724 (+2796%)
Mutual labels:  chat
Sketch Chat
A Sketch plugin to chat in Sketch Cloud files
Stars: ✭ 20 (-20%)
Mutual labels:  chat
Niltalk
Instant, disposable, single-binary web based live chat server. Go + VueJS.
Stars: ✭ 808 (+3132%)
Mutual labels:  chat
Spring Boot Websocket Chat Demo
Spring Boot WebSocket Chat Demo with SockJS fallback and STOMP protocol
Stars: ✭ 726 (+2804%)
Mutual labels:  chat
Call Forwarding Node
A sample implementation of advanced call forwarding using Twilio, Node.js and Express.js.
Stars: ✭ 6 (-76%)
Mutual labels:  twilio
Caprine
Elegant Facebook Messenger desktop app
Stars: ✭ 6,170 (+24580%)
Mutual labels:  chat
Peapod
A personal podcast service.
Stars: ✭ 24 (-4%)
Mutual labels:  twilio
Ghchat
📱A chat application for GitHub. React + PWA + Node(koa2) + Typescripts + Mysql + Socket.io
Stars: ✭ 791 (+3064%)
Mutual labels:  chat
Jackal
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).
Stars: ✭ 899 (+3496%)
Mutual labels:  chat
Convos
Convos 👥 is the simplest way to use IRC in your browser
Stars: ✭ 789 (+3056%)
Mutual labels:  chat
Socket Io Typescript Chat
A chat application implemented using Socket.io, TypeScript, Angular and Angular Material components
Stars: ✭ 771 (+2984%)
Mutual labels:  chat
Chat Messela Blockchain Messenger
Chat Message La - A Blockchain implementation for ultra-secure (just kidding!) messaging in Java
Stars: ✭ 16 (-36%)
Mutual labels:  chat
Chat Messaging App Light And Dark Theme
Stars: ✭ 715 (+2760%)
Mutual labels:  chat
Purple Facebook
Facebook protocol plugin for libpurple (moved from jgeboski/purple-facebook)
Stars: ✭ 924 (+3596%)
Mutual labels:  chat
Integrations
Connect your App to Multiple Messaging Channels with the W3C Open standard.
Stars: ✭ 721 (+2784%)
Mutual labels:  twilio
Routr
Routr: Next-generation SIP Server
Stars: ✭ 788 (+3052%)
Mutual labels:  twilio
Rskgrowingtextview
A light-weight UITextView subclass that automatically grows and shrinks.
Stars: ✭ 820 (+3180%)
Mutual labels:  chat
Skillbox Chat 08 19
Skillbox demo application for the Python course
Stars: ✭ 25 (+0%)
Mutual labels:  chat

React Native Twilio IP Messaging (Deprecated)

npm version

NOTE: This package is for the original Twilio IP Messaging SDKs. If you are using the newer Twilio Chat SDKs, please use our new package react-native-twilio-chat for the correct wrappers.

####Changelog

Installation

npm install --save react-native-twilio-ip-messaging

iOS, option 1 (not working well with react native 0.40.0 at the moment)

Install the Twilio IP Messaging SDK and this package via CocoaPods.
See the full Podfile example for more details.

pod 'RCTTwilioIPMessaging', :path => '../node_modules/react-native-twilio-ip-messaging/ios'

source 'https://github.com/twilio/cocoapod-specs'
pod 'TwilioIPMessagingClient', '~> 0.14.2'

Note: the underlying Twilio SDKs require a minimum deployment target of 8.1. If your project's target is less than this you will get a CocoaPods install error (Unable to satisfy the following requirements...).

Make sure that you add the $(inherited) value to Other Linker Flags and Framework Search Paths for your target's Build Settings. This is also assuming you have already loaded React via CocoaPods as well.

iOS, option 2 - manually

The twilio part of your Podfile would look like this

source 'https://github.com/twilio/cocoapod-specs'
pod 'TwilioIPMessagingClient', '~> 0.14.2'
  1. Open your project in Xcode, right click on Libraries and click Add Files to "Your Project Name" Look under node_modules/react-native-twilio-ip-messaging/ios and add RCTTwilioIPMessaging.xcodeproj.
  2. Add libRCTTwilioIPMessageing.a to `Build Phases -> Link Binary With Libraries.
  3. Click on RCTTwilioIPMessaging.xcodeproj in Libraries and go the Build Settings tab. Double click the text to the right of Header Search Paths and verify that it has $(SRCROOT)/../../react-native/React as well as $(SRCROOT)/../../../ios/Pods/Headers - if they aren't, then add them.

Android

In android/settings.gradle:

include ':RCTTwilioIPMessaging', ':app'
project(':RCTTwilioIPMessaging').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-twilio-ip-messaging/android')

In android/app/build.gradle:

...
dependencies {
    ...
    compile project(':RCTTwilioIPMessaging')
}

Register the module in MainActivity.java by calling addPackage():

// import package
import com.bradbumbalough.RCTTwilioIPMessaging.RCTTwilioIPMessagingPackage;

...

// register package in getPackages()
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        ... other packages
        new RCTTwilioIPMessagingPackage(),
        new MainReactPackage()
    );
}

Note: You might have to enable multidex in your build.gradle file and increase the heap size if you're getting errors while buliding. The minSdkVersion must also be at least 19, per the Twilio SDKs.

android {
    ....
    dexOptions {
        javaMaxHeapSize "2048M"
    }

    defaultConfig {
        ...
        minSdkVersion 19
        multiDexEnabled true
    }

Usage

/* Initialization */

let {
    AccessManager,
    Client,
    Constants
} = require('react-native-twilio-ip-messaging')

// create the access manager
var accessManager = new AccessManager(token);

// specify any handlers for events
accessManager.onTokenExpired = () => {
    getNewTokenFromServer()
    .then(accessManager.updateToken)
}

// create the client
var client = new Client(accessManager);

// specify any global events
client.onError = ({error, userInfo}) => console.log(error)

// initialize the client
client.initialize()

// wait for sync to finish
client.onClientSynchronized = () => {
    client.getChannels()
    .then((channels) => console.log(channels))
}

/* Individual Channel */

// somehow an instance of Channel is passed down in the app
var channel = this.props.channel

// specify channel specific events
channel.onMessageAdded = (message) => console.log(message.author + ": " + message.body)
channel.onTypingStarted = (member) => console.log(member.identity + " started typing...")
channel.onTypingEnded = (member) => console.log(member.identity + " stopped typing...")
channel.onMemberAdded = (member) => console.log(member.identity + " joined " + channel.friendlyName)

// sending a message
<TextInput
    onChangeText={(body) => {
        this.setState({body})
        channel.typing()
    }}
    onSubmitEditing={() => channel.sendMessage(this.state.body)}
/>

####Documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].