'How to open/install another APK file from inside React Native App built using expo

I have an android application built using expo (Managed Flow). I am trying to install/open a downloaded apk file from inside the application without success.

const fileUri = ...        
FileSystem.getContentUriAsync(fileUri).then(cUri => {
  console.log(cUri);
  IntentLauncher.startActivityAsync('android.intent.action.VIEW', {
    data: cUri,
    flags: 1,
    type: 'application/vnd.android.package-archive'
  });
});

I also tried:

const fileUri = ...
Linking.openURL(fileUri);

I need help. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source