16

JavSend Chat Invites Using Chirp

 5 years ago
source link: https://www.tuicool.com/articles/hit/meqqemq
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Chirp PubNub Chat

This project is a demo chat application that uses audible chirps to connect users to the same channel using the Chirp WebAssembly SDK and PubNub Javascript SDK .

nyMbyaV.gif

Using Chirp you can eliminate the need to users to manually enter the channel they want to join. The users only need to enable microphone access and turn up their speaker to connect to each other. Chirp is a great alternative to QR codes.

Want to learn more about this project or build a clone from scratch? Check out the tutorial .

AjUzaaV.png!web

What is Chirp?

Chirp’s SDKs allows you to send small amounts of data over sound. It is designed to work in noisy everyday environments and doesn’t require perfect silence to work. In my experiments I found that my chirps were received in almost every reasonable scenario I tested.

bINziiM.gif

Getting Started

Replace “YOUR_PUBNUB_PUBLISH_KEY_HERE” and “YOUR_PUBNUB_SUBSCRIBE_KEY_HERE” with your Publish Key and Subscribe Key from the PubNub Admin Dashboard .

Replace "YOUR_CHIRP_KEY_HERE" with your Chirp key from the applications page .

Although Chirp sends data completely offline, registration credentials are needed to identify your user account to the SDK, and to configure the SDK with your profile-specific features.

For web-based applications using the Chirp JavaScript or WebAssembly SDKs, applications are identified using your application key, and must be hosted on one of the web origins that you specify in the origins pane of your application .

CORS rules won’t allow the browser to load the Chirp WebAssembly SDK directly from the file system.

You must host the files using a server. I recommend http-server .

Install with NPM :

npm install http-server -g

Start the server from the same directory as your project files:

http-server

Add your origin to the origins pane of your application .

Br2IBvA.png!web

Visit http://localhost:8080 to view and test your chat application powered by Chirp and PubNub.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK