Closed Somnus007 closed 2 years ago
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
got command event ${JSON.stringify(data)}
{alanKey && }
Description:
onVisualState((p, s) => { console.log(s) });
AlanManager.setVisualState({ bool: true, string: 'haha', number: 123, array: [ 'q', 'w', 'e', 'r'], object: { name: 'allen', isTest: true, }, });
{ bool: true, number: 123, object: { isWorking: true, name: 'allen' }, string: 'haha' }
onVisualState
array: [ 'q', 'w', 'e', 'r'],
Fixed with version 1.10.0
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:
{ bool: true, number: 123, object: { isWorking: true, name: 'allen' }, string: 'haha' }
fromonVisualState
, missingarray: [ 'q', 'w', 'e', 'r'],
onVisualState
returns full data.