How can expo android react native app return a value when opened by an external app?

33 Views Asked by At

I am using odk collect to fill some forms. I am able to open my app from the odk form with ex:android.intent.action.VIEW(uri_data='myapp://hello/path') but I have not been able to respond with parameters. The odk documentation says that the external app should do the following:

Uri uri = ...
Intent returnIntent = new Intent();
returnIntent.clipData = ClipData.newRawUri(null, uri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
setResult(Activity.RESULT_OK, intent);
finish();

I am using expo's IntentLauncher to respond, but I always get a "No Activity found to handle Intent" response. );

I've been doing:

await startActivityAsync('android.intent.action.VIEW',
      {
        extra: { my_variable: 'my_response' },
        flags: 1,
      }
0

There are 0 best solutions below