Appstitch Twilio

Serverless Twilio Integrations for Appstitch

Platforms

  • iOS
  • Android
  • Web

Usage

Send Message


void sendMessage() async {
    final options = MessageOptions(
        from: "+1234567890",
        to: "+10987654321",
        body: "My First Twilio Message",
        );


    final result = await twilioClient
        .sendMessage(options);

    if (result.success!) {
        // Success
    } else {
        // handle error
    }
}

Send Message


void makeCall() async {
    final options = CallOptions(
        from: "+1234567890",
        to: "+10987654321",
        url: "http://demo.twilio.com/docs/voice.xml",
        );


    final result = await twilioClient
        .makeCall(options);

    if (result.success!) {
        // Success
    } else {
        // handle error
    }
}

Install

appstitch_core: ^2.0.2
appstitch_twilio: ^1.0.0

Initialize

import 'package:appstitch_core/options.dart';
import 'package:appstitch_core/core.dart';

Core core = Core();
Twilio twilioClient = Twilio();

@override
void initState() {
  super.initState();

  final options = Options(appstitchKey, clientID: clientID);
  core.initialize(options);

}

Libraries

appstitch_twilio
callOptions
messageOptions
response
types