Ionic3 Android chrome fileprovider

#1

Tech: Ionic, Android 8.1

Problem background

We want to open our custom .bcem file, downloaded from Chrome browser, on Android 8 (not version 6.x). Open “Download” menu in Android 8.x Chrome and click on a .bcem file.

The extension .bcem is registered with our app and should open the .bcem file in the app.

To access file content, we need access to its file path on disk. When we open file on Firefox or any other browser, the ionic plugin filepath.resolveNativePath(intent.data) is able to give us the filepath from intent.data. People familiar with Ionic and filepath plugin should be able to recognize this.

Problem

Opening a .bcem file from Download folder in Android 8.x Chrome gives the following intent

intent.action: “android.intent.action.VIEW”
intent.data = “content://com.android.chrome.FileProvider/downloads/demo.bcem”

Then subsequent calls to ionic’s fileplugin.resolveNativePath( intent.data ) fails to give access to file on disk.

What could be the issue?