Coder Social home page Coder Social logo

shubhamb-git / twiliochat-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twiliodeved/twiliochat-swift

0.0 1.0 0.0 1.82 MB

Swift implementation of Twilio Chat

Home Page: https://www.twilio.com/docs/tutorials/walkthrough/ip-chat/ios/swift

License: MIT License

Ruby 1.00% Swift 98.53% Objective-C 0.48%

twiliochat-swift's Introduction

twiliochat-swift

Build Status

Swift implementation of Twilio Chat

Running the Application

  1. Clone the repository and cd into it

  2. Install the application's dependencies with CocoaPods

    $ pod install
  3. Open the project with XCode but don't use twiliochat.xcodeproj file. For CocoaPods dependencies to work you must use twiliochat.xcworkspace.

  4. Twilio's IP Messaging Client requires an access token generated using your Twilio credentials in order to connect. First we need to setup a server that will generate this token for the mobile application to use. We have created web versions of Twilio Chat, you can use any of these applications to generate the token that this mobile app requires. Just pick your favorite flavor:

    Look for instructions on how to setup these servers in any of the links above.

  5. Once you have the server running (from the previous step), you need to edit one file in the Xcode project.

    ProjectRoot -> twiliochat -> resources -> Keys.plist
    

    This file contains the TokenRequestUrl key. The default value is http://localhost:8000/token. This address refers to the host machine loopback interface when running this application in the iOS simulator. You must change this value to match the address of your server running the token generation application. We are using the PHP - Laravel version in this case, that's why we use port 8000.

    Note: In some operating systems you need to specify the address for the development server when you run the Laravel application, here's an example:

    $ php artisan serve --host=127.0.0.1
    
  6. Now Twilio Chat is ready to go. Run the application on the simulator or your own device, just make sure that you have properly set up the token generation server and the TokenRequestUrl key. To run the application in a real device you'll need to expose your local token generation server by manually forwarding ports, or using a tool like ngrok. If you decide to work with ngrok, your Keys.plist file should hold a key like this one:

    TokenRequestUrl -> http://<your_subdomain>.ngrok.io/token
    

    No need to specify the port in this url, as ngrok will forward the request to the specified port.

twiliochat-swift's People

Contributors

juank-pa avatar joliveros avatar mcelicalderon avatar kathyguerron avatar kwhinnery avatar rbeiter avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.