sunsshadow / twilio-chat-demo-ios

Twilio Programmable Chat Demo Application for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chat Demo Application Overview

Getting Started

Welcome to the Chat Demo application. This application demonstrates a basic chat client with the ability to create and join channels, invite other members into the channels and exchange messages.

What you'll minimally need to get started:

The first step is to bring the .framework into the project. The easiest way to do this is to find the .framework in the tar.bz distribution and drag-n-drop it into the target's Embedded Frameworks section on the General settings tab.

Next, in the ChatManager.m file, find the line that Xcode will let you know is an error. Delete that #error line and fill in a client token in the line below:

    return nil;

You can either paste in a client token you have generated elsewhere or update this portion of code to call out to a webservice you control that can generate tokens.

Additional Configuration of Chat Instance

In order to allow members of a channel other than a message's original author to add reactions to messages in this demo, you will need to permit any channel member to modify a message's attributes. In a non-sample application, this could be handled more securely with a call initiated by your backend server and the system user should you wish to use message attributes for sensitive data that an arbitrary channel member should not be able to modify.

To learn more about Roles and Channels, you can visit the Role documentation. A quick example of enabling editing of any message's attributes using curl is:

curl -XPOST https://chat.twilio.com/v1/Services/{service sid}/Roles/{role sid} \
    -d "FriendlyName=channel user" \ 
    -d "Permission=sendMessage" \ 
    -d "Permission=leaveChannel" \ 
    -d "Permission=editOwnMessage" \ 
    -d "Permission=editOwnMessageAttributes" \ 
    -d "Permission=deleteOwnMessage" \ 
    -d "Permission=editAnyMessageAttributes" \ 
    -u '{twilio account sid}:{twilio auth token}'

About

Twilio Programmable Chat Demo Application for iOS


Languages

Language:Objective-C 99.9%Language:Ruby 0.1%