kunder-lab / com.borismus.webintent

0 stars 2 forks source link

Trying to interact with audio recorder - no output #4

Open marcomilone opened 4 years ago

marcomilone commented 4 years ago

Hello, I'm trying to get something back from https://play.google.com/store/apps/details?id=com.github.axet.audiorecorder&hl=en

What I'm supposed to get after that call? android.provider.MediaStore.RECORD_SOUND An URI with the file path? Or the file content? At the moment I'm not receiving anything in the callback.

first try (without url parameter)

window.plugins.webintent.startActivity({
    action: "android.provider.MediaStore.RECORD_SOUND"
},
    function(asd) {console.log("success");console.dir(asd);  },
    function(asd) {console.log("failed");console.dir(asd);}
);

the application is opened and I can sing my song... then...

output is nothing (file is saved inside accessible storage, see below).


with extras parameter

I can also inject an extras parameter (digged in the application code.. I'm zero in Java)

window.plugins.webintent.startActivity({
    action: "android.provider.MediaStore.RECORD_SOUND",
    extras: {
        recording: {
            targetUri: "file:///storage/emulated/0/my_path/new_file.mp3"
        }
    }
},
    function(asd) {console.log("success");console.dir(asd);  },
    function(asd) {console.log("failed");console.dir(asd);}
);

output is nothing as well (same same thing)

I see that the file is saved

/storage/emulated/0/Android/data/com.github.axet.audiorecorder/files/share/2020-04-13 02.22.06.ogg I'll like to have that path back from the callback.


I think can be interesting to many people.

marcomilone commented 4 years ago

I tried https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent

that is incompatible with some plugins (still have to start investigating)

It implements a very close interface to yours (i guess is a fork or similar), but works.

It has that method:

startActivityForResult

that (when the intent returns) returns an object with a result that your method startActivity seems to just ignore.