├── .circleci ├── bkp.yaml └── config.yml ├── Gemfile ├── README.md ├── examples └── testapp │ ├── .gitignore │ ├── AlanButton.js │ ├── AlanSDK.js │ ├── AlanText.js │ ├── App.js │ ├── __tests__ │ └── App.js │ ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── google-services.json │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── testtools │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── testtools │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── generated │ │ │ │ └── BasePackageList.java │ │ │ └── res │ │ │ ├── drawable │ │ │ ├── splashscreen.xml │ │ │ └── splashscreen_image.png │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ ├── app.json │ ├── babel.config.js │ ├── index.js │ ├── ios │ ├── Podfile │ ├── testtools.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── testtools.xcscheme │ ├── testtools.xcworkspace │ │ └── contents.xcworkspacedata │ └── testtools │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── SplashScreen.imageset │ │ │ ├── Contents.json │ │ │ └── splashscreen.png │ │ └── SplashScreenBackground.imageset │ │ │ ├── Contents.json │ │ │ └── background.png │ │ ├── Info.plist │ │ ├── SplashScreen.storyboard │ │ ├── Supporting │ │ └── Expo.plist │ │ └── main.m │ ├── metro.config.js │ ├── package-lock.json │ └── package.json └── fastlane └── Fastfile /.circleci/bkp.yaml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | jobs: 4 | analyse_js: 5 | executor: rn/linux_js 6 | steps: 7 | - attach_workspace: 8 | at: ./testtools 9 | - run: 10 | command: yarn install 11 | working_directory: ./testtools 12 | 13 | checkout_code: 14 | executor: rn/linux_js 15 | steps: 16 | - checkout 17 | - persist_to_workspace: 18 | paths: . 19 | root: . 20 | build_app: 21 | executor: rn/linux_android 22 | steps: 23 | - checkout 24 | - run: 25 | command: pwd 26 | - run: 27 | command: ls -al 28 | - run: 29 | name: Build Android RN Sample App (from testtools) 30 | command: cd ./testtools/android && ./gradlew assembleDebug 31 | 32 | orbs: 33 | rn: react-native-community/react-native@4.4.2 34 | android: circleci/android@0.2.1 35 | 36 | workflows: 37 | test: 38 | jobs: 39 | # - checkout_code 40 | # - analyse_js: 41 | # requires: 42 | # - checkout_code 43 | - build_app 44 | # requires: 45 | # - analyse_js 46 | # - rn/android_build: 47 | # project_path: ./testtools/android 48 | # build_type: release 49 | # requires: 50 | # - analyse_js 51 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # For a detailed guide to building and testing on iOS, read the docs: 2 | # https://circleci.com/docs/2.0/testing-ios/ 3 | 4 | version: 2.1 5 | 6 | orbs: 7 | node: circleci/node@4.7.0 8 | 9 | jobs: 10 | build_android: 11 | docker: 12 | - image: circleci/android:api-28-node 13 | resource_class: xlarge 14 | steps: 15 | - checkout 16 | - run: sudo mkdir /opt/gradle 17 | - run: sudo wget https://services.gradle.org/distributions/gradle-6.7-bin.zip 18 | - run: sudo unzip -d /opt/gradle gradle-6.7-bin.zip 19 | - run: echo 'export export PATH=$PATH:/opt/gradle/gradle-6.7/bin:$PATH' >> $BASH_ENV 20 | - run: gradle -v 21 | - run: 22 | name: Installing JDK 1.8 required for Cordova support 23 | command: | 24 | sudo apt update 25 | sudo apt install software-properties-common 26 | sudo apt update 27 | wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - 28 | sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ 29 | sudo apt update 30 | sudo apt install adoptopenjdk-8-hotspot 31 | echo 'export PATH=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin:$PATH' >> $BASH_ENV 32 | echo 'export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64' >> $BASH_ENV 33 | source $BASH_ENV 34 | - run: 35 | name: Setup PATH variables 36 | command: | 37 | export PATH=$ANDROID_HOME/platform-tools:$PATH 38 | export PATH=$ANDROID_HOME/tools:$PATH 39 | - restore_cache: 40 | keys: 41 | - node-modules-cache 42 | - run: 43 | name: Install React native 44 | command: sudo npm install -g react-native-cli 45 | - run: 46 | name: Install Dependencies npm 47 | command: cd examples/testapp && npm install 48 | - save_cache: 49 | key: node-modules-cache 50 | paths: 51 | - ./node_modules 52 | - run: 53 | name: Build android 54 | command: cd examples/testapp/android && ./gradlew assembleDebug 55 | 56 | 57 | build_ios: 58 | macos: 59 | xcode: 11.3.0 60 | steps: 61 | - checkout 62 | - node/install: 63 | node-version: 16.13.0 64 | - run: node --version 65 | - run: 66 | name: Install yarn 67 | command: npm install --global yarn 68 | - run: 69 | name: decode Certificates 70 | command: base64 -D -o Certificates.p12 \<<< $Certificates 71 | - run: 72 | name: make Provisioning Profiles directory 73 | command: mkdir -pv ~/Library/MobileDevice/Provisioning\ Profiles/ 74 | - run: 75 | name: decode Provisioning Profiles 76 | command: base64 -D -o ~/Library/MobileDevice/Provisioning\ Profiles/App_Store.mobileprovision \<<< $App_Store_Profile 77 | - run: bundle exec fastlane clean 78 | - run: 79 | name: Install cocoapods 80 | command: sudo gem install cocoapods 81 | - run: 82 | name: Install React native 83 | command: sudo npm install -g react-native-cli 84 | - run: 85 | name: export path 86 | command: echo 'export PATH="$PATH:/usr/local/bin"' >> $BASH_ENV 87 | - run: 88 | name: Install Dependencies npm 89 | command: cd examples/testapp && npm install 90 | - run: 91 | name: Install Dependencies cocoapods 92 | command: cd examples/testapp/ios && pod install 93 | - run: 94 | name: React native build for iOS Release 95 | command: cd examples/testapp/ios && xcodebuild -workspace "testtools.xcworkspace" -scheme "testtools" -configuration Release 96 | 97 | workflows: 98 | version: 2.1 99 | build-android-and-ios: 100 | jobs: 101 | - build_android 102 | - build_ios 103 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # Gemfile 2 | source "https://rubygems.org" 3 | gem 'fastlane' -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Self-Coding System for Your App — Alan AI SDK for React Native 2 | 3 | [Alan AI Platform](https://alan.app/) • [Alan AI Studio](https://studio.alan.app/register) • [Docs](https://alan.app/docs) • [FAQ](https://alan.app/docs/usage/additional/faq) • 4 | [Blog](https://alan.app/blog/) • [Twitter](https://twitter.com/alanvoiceai) 5 | 6 | [![npm](https://img.shields.io/npm/v/@alan-ai/alan-sdk-react-native.svg)](https://www.npmjs.com/package/@alan-ai/alan-sdk-react-native) 7 | 8 | Quickly create AI agents with the Alan AI Platform. Enable human-like conversations and perform actions in any app through voice commands. 9 | 10 | ## The Intelligent App Platform 11 | 12 | Alan AI is transforming enterprise software with a new approach, **Application-Level AI**. Instead of relying on manual development or isolated AI tools, we embed an intelligent layer into your application that builds features on demand. 13 | 14 | Powered by our proprietary **Three-Layer AI (3LAI)** architecture, our system generates both business logic and UI in real time—no developers needed. It works across your entire app stack: the user interface, business logic, and data management. 15 | 16 | The **Intelligent App Platform** lets companies integrate AI-driven interfaces into their existing apps in days, not months. 17 | 18 | It creates a safe and validated environment from your app’s APIs, GUIs, and documentation, enabling accurate, context-aware code generation. At runtime, the AI acts like a self-coding engine—instantly creating new features based on user needs. 19 | 20 | With Alan AI, your software becomes truly adaptive—responding, evolving, and scaling automatically. 21 | 22 | This repository contains the **Alan AI SDK for React Native**, enabling you to embed Alan's intelligent layer into your Android applications. 23 | 24 | ## How to start 25 | 26 | To create an AI agent for your React Native app: 27 | 1. Sign up for Alan AI Studio to build dialog scripts in JavaScript and test them. 28 | 2. Use the Alan AI SDK for React Native to embed an AI agent to your application. For details, see Alan AI documentation. 29 | 30 | 31 | ## Example apps 32 | 33 | In the [Examples](https://github.com/alan-ai/alan-sdk-reactnative/tree/master/examples) folder, you can find example apps integrated with the Alan AI SDK for React Native. Launch the app, tap the Alan AI button and start giving voice commands. For example, you can ask: "Hello" or "What does this app do?" 34 | 35 | ## Other platforms 36 | 37 | You may also want to try Alan AI SDKs for the following platforms: 38 | 39 | * Web 40 | * iOS 41 | * Android 42 | * Flutter 43 | * Ionic 44 | * Apache Cordova 45 | * PowerApps 46 | 47 | ## Have questions? 48 | 49 | If you have any questions or something is missing in the documentation: 50 | - Join [Alan AI Slack community](https://app.slack.com/client/TL55N530A) for support 51 | - Contact us at [support@alan.app](mailto:support@alan.app) -------------------------------------------------------------------------------- /examples/testapp/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | # node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://docs.fastlane.tools/best-practices/source-control/ 49 | 50 | */fastlane/report.xml 51 | */fastlane/Preview.html 52 | */fastlane/screenshots 53 | 54 | # Bundle artifacts 55 | *.jsbundle 56 | 57 | # CocoaPods 58 | /ios/Pods/ 59 | 60 | # Expo 61 | .expo/* 62 | web-build/ 63 | -------------------------------------------------------------------------------- /examples/testapp/AlanButton.js: -------------------------------------------------------------------------------- 1 | /*jshint esversion: 6 */ 2 | 3 | import PropTypes from 'prop-types'; 4 | import React from 'react'; 5 | import {requireNativeComponent} from 'react-native'; 6 | 7 | class AlanButton extends React.Component { 8 | render() { 9 | return ; 10 | } 11 | } 12 | 13 | AlanButton.propTypes = { 14 | projectid: PropTypes.string, 15 | }; 16 | 17 | var RNTAlanButton = requireNativeComponent('RNTAlanButton', AlanButton); 18 | module.exports = AlanButton; -------------------------------------------------------------------------------- /examples/testapp/AlanSDK.js: -------------------------------------------------------------------------------- 1 | /*jshint esversion: 6 */ 2 | 3 | import PropTypes from 'prop-types'; 4 | import React from 'react'; 5 | import {Text, View, StyleSheet} from 'react-native'; 6 | import {requireNativeComponent} from 'react-native'; 7 | 8 | const styles = StyleSheet.create({ 9 | textView: { 10 | height: 64, 11 | right: 20, 12 | left: 20, 13 | justifyContent: 'center', 14 | alignItems: 'center', 15 | position: 'absolute', 16 | }, 17 | buttonView: { 18 | width: 64, 19 | height: 64, 20 | right: 20, 21 | justifyContent: 'center', 22 | alignItems: 'center', 23 | position: 'absolute', 24 | }, 25 | bottomView: { 26 | width: '100%', 27 | height: 64, 28 | bottom: 40, 29 | justifyContent: 'center', 30 | alignItems: 'center', 31 | position: 'absolute', 32 | }, 33 | }); 34 | 35 | class AlanButton extends React.Component { 36 | render() { 37 | return ; 38 | } 39 | } 40 | 41 | AlanButton.propTypes = { 42 | params: PropTypes.array, 43 | }; 44 | 45 | var RNTAlanButton = requireNativeComponent('RNTAlanButton', AlanButton); 46 | 47 | class AlanText extends React.Component { 48 | render() { 49 | return ; 50 | } 51 | } 52 | 53 | AlanText.propTypes = { 54 | }; 55 | 56 | var RNTAlanText = requireNativeComponent('RNTAlanText', AlanText); 57 | 58 | class AlanView extends React.Component { 59 | render() { 60 | return 61 | 62 | 71 | ; 72 | } 73 | } 74 | 75 | AlanView.propTypes = { 76 | projectid: PropTypes.string, 77 | host: PropTypes.string, 78 | authData: PropTypes.object, 79 | }; 80 | 81 | module.exports = { 82 | AlanView: AlanView, 83 | }; 84 | -------------------------------------------------------------------------------- /examples/testapp/AlanText.js: -------------------------------------------------------------------------------- 1 | /*jshint esversion: 6 */ 2 | 3 | import PropTypes from 'prop-types'; 4 | import React from 'react'; 5 | import {requireNativeComponent} from 'react-native'; 6 | 7 | class AlanText extends React.Component { 8 | render() { 9 | return ; 10 | } 11 | } 12 | 13 | AlanText.propTypes = { 14 | }; 15 | 16 | var RNTAlanText = requireNativeComponent('RNTAlanText', AlanText); 17 | module.exports = AlanText; 18 | -------------------------------------------------------------------------------- /examples/testapp/App.js: -------------------------------------------------------------------------------- 1 | /*jshint esversion: 6 */ 2 | 3 | import React, {Component} from 'react'; 4 | import { 5 | Button, 6 | TextInput, 7 | View, 8 | Text, 9 | StyleSheet, 10 | Alert, 11 | ScrollView, 12 | KeyboardAvoidingView, 13 | Dimensions, 14 | Switch, 15 | } from 'react-native'; 16 | import {NativeEventEmitter, NativeModules} from 'react-native'; 17 | 18 | import {AlanView} from './AlanSDK.js'; 19 | 20 | const {AlanManager, AlanEventEmitter} = NativeModules; 21 | const alanEventEmitter = new NativeEventEmitter(AlanEventEmitter); 22 | 23 | const screenWidth = Dimensions.get('window').width; 24 | const textWidth = screenWidth - 40; 25 | 26 | const createAlert = (text) => 27 | Alert.alert( 28 | text, 29 | text, 30 | [{text: 'OK', onPress: () => console.log('OK Pressed')}], 31 | {cancelable: false}, 32 | ); 33 | 34 | const subscription = alanEventEmitter.addListener('command', (data) => { 35 | console.log(`got command event ${JSON.stringify(data)}`); 36 | // {"command":"showAlert","text":"text"} 37 | createAlert(data.text); 38 | }); 39 | 40 | export default class HelloWorldApp extends Component { 41 | constructor(props) { 42 | super(props); 43 | 44 | this.state = { 45 | helloValue: '(test text | hello | test tools)', 46 | commandValue: 'test command', 47 | apiValue: 'test project api', 48 | visualValue: 'test visual state', 49 | sendCommandValue: 'test send command', 50 | authDataValue: 'test auth data', 51 | authData: false, 52 | isProd: false, 53 | }; 54 | } 55 | 56 | componentWillUnmount() { 57 | subscription.remove(); 58 | } 59 | 60 | renderAlanButton() { 61 | if (this.state.isProd && this.state.authData) { 62 | this.state.authData = false; 63 | return ( 64 | 71 | ); 72 | } 73 | else if (this.state.isProd) { 74 | return ( 75 | 81 | ); 82 | } 83 | else if (this.state.authData) { 84 | this.state.authData = false; 85 | return ( 86 | 93 | ); 94 | } 95 | else { 96 | return ( 97 | 103 | ); 104 | } 105 | } 106 | 107 | render() { 108 | console.log(`isProd - ${this.state.isProd}`); 109 | console.log(`authData - ${this.state.authData}`); 110 | console.log(`authDataValue - ${this.state.authDataValue}`); 111 | const alanButton = this.renderAlanButton(); 112 | 113 | return ( 114 | 115 | 120 | 128 | 129 | 130 | 131 | Stage 132 | this.setState({isProd: val})} 136 | value={this.state.isProd} 137 | /> 138 | Prod 139 | 140 |