Code Monkey home page Code Monkey logo

twiliochatxamarinbindings's Introduction

Twilio Chat Xamarin Bindings

NuGet version (Twilio.Chat.Xamarin)

This repo holds Xamarin project to create Twilio Chat Bindings for Xamarin apps (Android and iOS) and Sample projects for Android and iOS to demonstrate how it can be used. The bindings itself are published ot NuGet.org with name Twilio.Chat.Xamarin

Building component

Requirements

  • Xamarin (Visual Studio Community edition)
  • android-sdk
  • xcode (with xcode command-line tools)
  • gradle
  • cocoapods

Building component

cd Twilio.Chat
./nugetBuildAndPack.sh
cd -

This will clean the project, fetch necessary libs for Android (through Gradle) and iOS (through CocoaPods), build the component and package it to NuGet package.

Documentation

Where it's possible, the documentation is built into the Xamarin Component. However, it's not full. It's always a good idea to consult with Twilio documentation for respective SDK (iOS or Android): https://www.twilio.com/docs/api/chat/sdks

Sample app

Overview

The sample app consists of Xamarin Forms project ChatDemo, shared code ChatDemo.Shared and platform specific projects ChatDemo.iOS and ChatDemo.Droid. The sample project is fully functional Twilio Chat demo app which works in such way:

  • asks for identity and token provider url
  • initializes Twilio Chat client with token token provided by token provider for given identity
  • fetches all user subscribed channels, gets last 10 messages from channel and gets member count for channels
  • subscribes to all events and logs it to the device screen and in the device log
  • subsribes for push notifications (FCM for Android and APNS for iOS) and handles the pushes

Building the sample app

Building the sample project is done from Visual Studio Community Edition for Mac, given that further mentioned prerequisites are met.

Common

  • configure Token Provider to generate Twilio token for given identity:

We recommend to host the token provider using Twilio Runtime Functions. The one should create new Runtime Function and provide necessary values to it. Here one can find sample of Runtime function to generate Twilio Token based on provided identity and pushChannel.

Android

  • setup the the FCM with help of Firebase console and put the correct google-services.json file to the Sample/ChatDemo.Droid folder.
  • create new credential resource in Twilio Console and setup Token Provider to return this credential sid in Twilio Token for the Android app

iOS

  • generate certificates and provisioning profile in Apple Developer console and set the Xamarin to use those for the iOS app signing of ChatDemo.iOS project
  • create new credential resource in Twilio Console and setup Token Provider to return this credential sid in Twilio Token for the iOS app

twiliochatxamarinbindings's People

Contributors

aleksandrsivanovs avatar

Watchers

 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.