Hello everyone,
I’m working on the RICOH THETA client using React Native Android and wanted to share how to use the fake api endpoint to use the list photos command if you don’t have a camera.
Changing real api endpoint to fake api endpoint for testing
- clone down the repo from GitHub to your computer.
- From the root theta-client directory Change Directory into demos/demo-react-native/src/MainMenu.tsx , for the react native demo
cd demos/demo-react-native/src/MainMenu.tsx
- Swap out the real api endpoint with the fake-theta api endpoint
- Run an android emulator from the command line with npm run android
demos\demo-react-native\src\MainMenu.tsx
Seeing how List Photos command works
- Imported libraries from theta-client-react-native shown on lines 14-19
demos\demo-react-native\src\ListPhotos.tsx
import {
listFiles,
getThetaInfo,
FileTypeEnum,
FileInfo,
} from 'theta-client-react-native';
- Main function that list all the image files lines 21-24
const listPhotos = async () => {
const {fileList} = await listFiles(FileTypeEnum.IMAGE, 0, 1000);
return fileList;
};
As shown in the demo applications code using our function lists 1000 files, currently we can see more than 5 being listed lets limit this to 3.