Git Product home page Git Product logo

telephony's Introduction

Telephony

Join the chat at https://gitter.im/ghuntley/telephony

Telephony will be a xplat library that provides email, sms, voice and video call functionality.

Supported Platforms

  • Xamarin.iOS
  • Xamarin.Android
  • Windows Phone 8/8.1 (Silverlight)
  • Windows Phone 8.1 (WPA)

Installation

Installation is done via NuGet:

Install-Package Telephony

Usage

Within your core library:

using Telephony;
using ReactiveUI;
using Conditions;

public ReactiveCommand<string> DialPhoneNumber { get; private set; }
public ReactiveCommand<string> ComposeMessage { get; private set; }
private readonly _telephony;

ExampleViewModel(ITelephony telephony)
{
	// Cool stuff: Conditions is cross platform portable class library helps
	// developers to write pre- and postcondition validations in a fluent
    // manner. Usage is completely optional and this is here to act as a
    // safety step/tear down the house if you forget to register an
    // implementation of the TelephoneyService<T> 
    Condition.Requires(telephone).IsNotNull();
    
    _telephony = telephony;
    
    // ReactiveUI is completely optional but you totally should be using it
    // as once you experience building a mobile application declaratively
    // using the Reactive Extensions theres no going back. 
    DialPhoneNumber = ReactiveCommand.Create();
   	
   	DialPhoneNumber.Subscribe(phoneNumber => 
   	{
   		// This is telephony, choose between either video or voice.
   		_telephony.MakePhoneCall(phoneNumber);
   		_telephony.MakeVideoCall(phoneNumber);
   	});
   	
	DialPhoneNumber.ThrownExceptions
        .Subscribe(ex => {
            UserError.Throw("Is Airplane mode enabled?", ex);
    });

    // ReactiveUI is completely optional but you totally should be using it
    // as once you experience building a mobile application declaratively
    // using the Reactive Extensions theres no going back. 
    ComposeMessage = ReactiveCommand.Create();
   	
   	ComposeMessage.Subscribe(phoneNumber => 
   	{
   		// This is telephony, choose between either SMS or email.
   		_telephony.ComposeSMS(phoneNumber);
   		_telephony.ComposeEmail(new Email("[email protected], [email protected]"));
   	});
   	
	ComposeMessage.ThrownExceptions
        .Subscribe(ex => {
            UserError.Throw("Is messaging enabled and are there accounts configured?", ex);
    });
}

Within the application initialization for each platform:

container.Register(c => new TelephonyService()).As<ITelephonyService>();

With thanks to

telephony's People

Contributors

ghuntley avatar gitter-badger 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.