Giter VIP home page Giter VIP logo

chirp-flutter's Introduction

ChirpSDK (Beta)

Send data with sound.

Getting Started

Sign up at the Chirp Developer Hub

Copy and paste your Chirp app key, secret and chosen configuration into the example application

await ChirpSDK.init(_appKey, _appSecret);
await ChirpSDK.setConfig(_appConfig);
await ChirpSDK.start();

Please see the example for a more detailed run through of how to use the Chirp SDK. For example the Chirp SDK async methods must called inside a Future async parent method.

Permissions

To grant iOS apps permission to use the microphone, you will need to add a Privacy - Microphone Usage Description statement to the Info.plist in the Runner xcode project.

For Android you will need to edit the AndroidManifest.xml file to include

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Sending

Chirp SDKs accept data as an array of bytes, creating a versatile interface for all kinds of data. However in most cases, Chirp is used to send a short identifier. Here is an example of how to send a short string with the Chirp SDK.

String identifier = "hello";
var payload = new Uint8List.fromList(identifier.codeUnits);
await ChirpSDK.send(payload);

It is worth noting here that the send method will not block until the entire payload has been sent, but just as long as it takes to pass the message to the SDK. Please use the onSent callback for this purpose.

Receiving

To receive data you can listen for received events like so

ChirpSDK.onReceived.listen((e) {
    String identifier = new String.fromCharCodes(e.payload);
});

A received event includes the payload and the channel for multichannel configurations. There are several other callbacks available which are illustrated in the example.

Contributions

This project aims to be a community driven project and is open to contributions. Please file any issues and pull requests at GitHub Thank you!

chirp-flutter's People

Contributors

joextodd avatar dinuchiriac avatar iampawan avatar ksivamuthu 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.