Menu

1 / 5

Making a React Native app agent-ready: what happens when Siri calls and your JavaScript isn't running

DEV Community: reactnative·Praveen Singh·5 days ago
#dvRQ3ZaC
#devtoreactnative#devto#dev#sqlite#expo
Reading 0:00
15s threshold

At a glance

Problem: Siri or Gemini calls your React Native app while its JavaScript isn't running

Fix: Do the work natively, against the same database and the same SQLite copy as your JavaScript

Result: 5 ms vs next launch (time to save a task with the app closed: done in Swift vs queued for JavaScript)

Short answer: With expo-app-intents , Siri can call a React Native app, but perform() runs in Swift and the library only queues the call for JavaScript. With the app closed, a queued task wasn't saved until the app was next opened. Opening the app works but takes about 2 seconds of cold JavaScript start. Doing the work in Swift saved the task in 5–23 ms, but only after one fix: Swift has to use expo-sqlite's own copy of SQLite. With the system copy, the app silently lost a task JavaScript had just saved. Android's AppFunctions have the same shape and, from the expo-sqlite source, the same SQLite risk; I haven't run the Android half yet.

Assistants are learning to use apps without opening them.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.