We store attachments as BLOBs along with prompts in a flat-file SQLite database (see #243). To display them at runtime, we render an <Image> which points to a special x-orbit-sqlattachment:// URL. We then implement an RCTImageURLLoader (on iOS) to resolve that URL by fetching the BLOB from the database: see ORSQLImageURLLoader.
We need to implement the equivalent image URL loader on Android.
To test:
yarn dev in backend
yarn web in app
yarn dev in web-component
Visit http://localhost:5000, review the prompts in the second review area (which include attachments) by marking them as forgotten (i.e. so that they're due immediately).
yarn android, sign in as test@test.com / testtest. You should see the attachments as expected.
We store attachments as BLOBs along with prompts in a flat-file SQLite database (see #243). To display them at runtime, we render an
<Image>
which points to a specialx-orbit-sqlattachment://
URL. We then implement anRCTImageURLLoader
(on iOS) to resolve that URL by fetching the BLOB from the database: seeORSQLImageURLLoader
.We need to implement the equivalent image URL loader on Android.
To test:
yarn dev
inbackend
yarn web
inapp
yarn dev
inweb-component
yarn android
, sign in astest@test.com
/testtest
. You should see the attachments as expected.