0.0.14 • Published 6 years ago

react-gigagenie v0.0.14

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

react-gigagenie

A KT GiGA Genie Component for React

Install

yarn add react-gigagenie

How to use

There're some steps to take to create your custom map components. 1. In order to initialize the MyComponent with the credential, you'll need to wrap it with withCredential HOC. 1. In order to correctly load gigagenie JavaScript client library, you'll need to wrap it with withScriptjs. 1. Notice there're some required props for withCredential and withScriptjs HOC.

import { withScriptjs, withCredential } from "react-gigagenie"

const MyComponent = withScriptjs(withCredential((props) =>
  <span>
    {props.displayName}
  </span>
))

<MyComponent
  apikey='YOUR_API_KEY'
  keytype='GBOXDEVM'
/>

Example

import GigaGenie from 'react-gigagenie';
import React, {Component} from 'react';

class VoiceTest extends Component {
  constructor(props) {
    Voice.onActionEvent = this.onActionEventHandler.bind(this);
  }
  onStartButtonPress(e){
    GigaGenie.getVoiceText('en-US');
  }
  ...
}

All methods now return a new Promise for async/await compatibility.

Method NameDescription
GigaGenie.getVoiceText(text, locale)Starts listening for speech for a specific locale. Returns null if no error occurs.
GigaGenie.stopTTS()Cancels the speech recognition. Returns null if no error occurs.
Event NameDescriptionEventPlatform
Voice.onActionEvent(event)Invoked when SpeechRecognizer stops recognition.{ error: false }Android, iOS
0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago