Code Monkey home page Code Monkey logo

alan-sdk-reactnative's People

Contributors

aermilin avatar annmirosh avatar dvl-es avatar okolyachko avatar snyuryev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alan-sdk-reactnative's Issues

WARN: `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

Versions:
Device OS version: Android 13
React native version: 0.70.6
@alan-ai/alan-sdk-react-native: 1.18.0

Reproduce steps:

  • Create a new react native project
  • Implement the most basic Alan integration: https://alan.app/docs/client-api/cross-platform/react-native/
  • Run the project on the localhost
  • There will be a WARN on the terminal: new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.

This library does not work on react native

after i run npm i @alan-ai/alan-sdk-react-native --save the react native app will now work anymore , it will constantly give error when i try to start the project. I have tried creating several new projects but same results

setVisualState method does not support Array type data

Versions:
Device OS version: Android 9
React native version: 0.66.3
@alan-ai/alan-sdk-react-native: 1.8.0

Integrate code:

Subscribe

import {NativeEventEmitter, NativeModules} from 'react-native';
const {AlanManager, AlanEventEmitter} = NativeModules;
const alanEventEmitter = new NativeEventEmitter(AlanEventEmitter);
const alanSubscriber = alanEventEmitter.addListener('command', data => {
console.log(got command event ${JSON.stringify(data)});
});
Alan Button

{alanKey && }

Description:

  • In the voice script
onVisualState((p, s) => {
    console.log(s)
});
  • Run app on Android device, try to set visual state
AlanManager.setVisualState({
        bool: true,
        string: 'haha',
        number: 123,
        array: [ 'q', 'w', 'e', 'r'],
        object: {
          name: 'allen',
          isTest: true,
        },
      });
  • I can only get { bool: true, number: 123, object: { isWorking: true, name: 'allen' }, string: 'haha' } from onVisualState, missing array: [ 'q', 'w', 'e', 'r'],
  • Try to set the same visual state on debug mode of Alan AI console, onVisualState returns full data.

<AlanView /> can not be removed

In my case, I want to display the Alan button after the user logs in. It works well. But when the user logs out, the Alan button still exists, even though its parent component has been removed

requireNativeComponent: "RNTAlanButton" was not found in the UIManager

I installed @alan-ai/alan-sdk-react-native for using Alan ai in my expo project. It was fine with the installation but when I imported AlanView from @alan-ai/alan-sdk-react-native and rendered in the home page it gives this error. I am trying but unable to resolve it since 2 days now.
I followed
https://www.youtube.com/watch?v=ttGfydUvg6A&t=264s
exactly as it is in the video but still get the error
I am testing it on android version 12 on expo go app as and using the same template as in the video
The only thing different from video I did is that I used --legacy-peer-deps for installing @alan-ai/alan-sdk-react-native as it was having dependencies conflicts
Here is package.json of my project:

image

The error :

Screenshot_2023-01-20-20-22-54-91_f73b71075b1de7323614b647fe394240

Can't use this package with create-expo app

This package is not compatible with expo

How you can reproduce this issue

  • npm i -g expo-cli
  • npx create-expo-app my-app
  • npm i @alan-ai/alan-sdk-react-native
  • import { AlanView } from '@alan-ai/alan-sdk-react-native';

Add Alan Button to your react native App Screen with project key from Alan Studio

<AlanView projectid={ALANSDK_PROJECT_KEY}/>

You will get this type of error in the terminal

image

The alan sdk package runs very well on Android Studio Emulator but after a lot of configurations on the emulator.

Issue with hot reload in react native

Problem, when developing, the Alan button will cause a problem with the hot reload of react native. Steps to reproduce the problem:

  1. Create a new react native project
  2. Implement the most basic Alan integration: https://alan.app/docs/client-api/cross-platform/react-native/
  3. Run the project on the localhost
  4. Open the app and wait for Alan to finish loading without any other actions
  5. Change something in your code (such as adding a line of text) to trigger a hot reload
  6. You will find that the "refreshing..." prompt will pop up twice in a row, and then the app will get stuck

TVOS Support

Will there be any support for React Native TVOS?

Exception in native call from JS

Versions:
Device OS version: Android 9
React native version: 0.65.1
@alan-ai/alan-sdk-react-native: 1.6.0

Integrate code:

  • Subscribe
import {NativeEventEmitter, NativeModules} from 'react-native';
const {AlanManager, AlanEventEmitter} = NativeModules;
const alanEventEmitter = new NativeEventEmitter(AlanEventEmitter);

const alanSubscriber = alanEventEmitter.addListener('command', data => {
  console.log(`got command event ${JSON.stringify(data)}`);
});
  • Alan Button
    {alanKey && <AlanView projectid={alanKey} />}

Reproduce steps:

  1. Run app in development mode on Android device
  2. Alan AI works well
  3. Exit the application
  4. Reopen the application
  5. The error will occur
  6. Remove AlanView, the error won't occur.

screenshot

Question

Hi, kind staff, could I ask if it was possible to change Alan's image and be able to put a Gif? eventually I could modify the interface of him and customize it to my liking?

Removing Text Panel

I do not need the text panel with words. Can it be removed (and how) to only leave the button?

The "data" JSON from the command listener contains only the "command" field, missing custom data from the voice script

Versions:
Device OS version: Android 9
React native version: 0.65.1
@alan-ai/alan-sdk-react-native: 1.6.0

Integrate code:

Subscribe

import {NativeEventEmitter, NativeModules} from 'react-native';
const {AlanManager, AlanEventEmitter} = NativeModules;
const alanEventEmitter = new NativeEventEmitter(AlanEventEmitter);
const alanSubscriber = alanEventEmitter.addListener('command', data => {
  console.log(`got command event ${JSON.stringify(data)}`);
});

Alan Button

{alanKey && <AlanView projectid={alanKey} />}

Description:

  • Run on Android device, the "data" JSON from the command listener contains only the "command" field, missing custom data from the voice script
  • Run on debug mode of Alan AI console, it returns full data.

Can't import AlanView

Hello, I'm using Windows and "expo": "~39.0.2" and tried to import AlanView like this:
import { AlanView } from "@alan-ai/alan-sdk-react-native/AlanSDK"

However, I got this error:

err

I also tried copying files: AllanButton, AlanSDK, AlanText from node modules to the root app directory manually, but then got these errors:
err2
err3

Is there something wrong about how I'm importing the files or is it expo, or maybe some other issue?

The app crashes when trying to close the app

Versions:
Device OS version: Android 9
React native version: 0.66.3
@alan-ai/alan-sdk-react-native: 1.10.0

Reproduce steps:

  1. Create a new react native project
  2. Implement the most basic Alan integration: https://alan.app/docs/client-api/cross-platform/react-native/
  3. Run the project on the localhost or run a release version of the demo app
  4. Open the app and wait for Alan to finish loading without any other actions
  5. Close the application, the application will crash (Not every time, please try a few more times)

Screenshot_2021-12-14-13-34-03-361_com miui bugre

Sharing the script (enhancement)

Is there a way to share a voice script within the Studio with someone else? Does there need to be some kind of ID to be added to the URL or similar?

Package not install

โฏ sudo npm i @alan-ai/alan-sdk-react-native --save

@alan-ai/[email protected] postinstall /Users/codrain/Desktop/React Native/alanNews/node_modules/@alan-ai/alan-sdk-react-native
cp AlanSDK.js $INIT_CWD && cp AlanButton.js $INIT_CWD && cp AlanText.js $INIT_CWD

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
npm ERR! code ELIFECYCLE
npm ERR! errno 64
npm ERR! @alan-ai/[email protected] postinstall: cp AlanSDK.js $INIT_CWD && cp AlanButton.js $INIT_CWD && cp AlanText.js $INIT_CWD
npm ERR! Exit status 64
npm ERR!
npm ERR! Failed at the @alan-ai/[email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/codrain/.npm/_logs/2021-01-16T16_24_42_297Z-debug.log

Use Alan along with audio libraries

alan-ai: latest version
react-native: 0.66.3
iOS: 14.6 (Iphone XR)

In my app I have the expo-av module (for implementing audio playback). And Alan works perfectly until I use this or any other audio library. Alan just stops using phone's microphone and listening to commands after I use any methods of these libraries.
Is it possible that they use the same native audio module and interrupt each other?
And is there a way to kind of reinitialize Alan?

IE issues

Cannot see the Alan button in Internet Explorer.

Navigator Error

After adding the AlanButton to app:

import alanBtn from "@alan-ai/alan-sdk-web";
alanBtn({
key: "myKey",
rootEl: document.getElementById("alan-btn")
});

function Layout({ children }) {return (
<>

 <main>
   <Banner />

   {children}
   <div id="alan-btn"></div>
 </main>

 <Footer />

</>
);
}

Error after building it:

ReferenceError: navigator is not defined
at undefined.window.alanAudio (/Users/james/Work/ssrtest/node_modules/@alan-ai/alan-sdk-web/index.js:13:5)
at /Users/james/Work/ssrtest/node_modules/@alan-ai/alan-sdk-web/index.js:271:3
at /Users/james/Work/ssrtest/node_modules/@alan-ai/alan-sdk-web/index.js:5:22
at Object. (/Users/james/Work/ssrtest/node_modules/@alan-ai/alan-sdk-web/index.js:9:2)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at

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.