How to open ODK collect app from React Native app?

Using expo's react native, we were able to open odk to launch the list of forms.

import { startActivityAsync } from 'expo-intent-launcher';

const onPressOdk = async () => {
  await startActivityAsync('android.intent.action.VIEW', {
    type: 'vnd.android.cursor.dir/vnd.odk.form',
  });
}

However we couldn't do much more than that with react-native/expo's intent tools, and we ended up making a native module for more specific actions.

1 Like