Detect incoming calls without permissions

Hello,
I have a problem with an application that plays streaming audio. The problem is that when someone calls me on the phone, I get an error and the audio keeps playing over the call.

I have managed to solve this problem by using a block that allows me to detect incoming calls, but for this it requires different call permissions (according to google play "sensitive permissions") and there is no way for Google play to approve my app.

Is there any way to detect incoming calls without the need to require the permissions to call access...?
Thanks

Imagen del error:

I don't think that's possible. Android should restrict ist.

Why do you see a problem in asking for call permissions? I mean almost every app has it nowadays.

1 Like

Google play console makes me fill in a form and I get denied all the time :frowning:

which component are you using to play that streaming audio?
to add the phone call component can't be the solution...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

The audio player
Thanks

try the OtherPlayerStarted event to pause your audio
http://ai2.appinventor.mit.edu/reference/components/media.html#Player

Taifun

1 Like

Ok thanks I will try

Hello, I have tried it and it seems that it does not work to detect a call.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

It's a bit complicated to understand :sweat_smile:

I know that the component that causes me this error is the timer that I have, since if it detects that nothing is playing it makes it play again. But if I do not put this timer, if I leave the app and go to another, the audio lasts a while and stops.

thanks

yes, I think you have to remove the timer
does the OtherPlayerStarted event work then? I don't see you using it...
also remove the Phone call component as already said earlier...

I think, @Anke has a solution to that issue?
Taifun

1 Like

OK thanks :grin: @Taifun

1 Like

See also here:

1 Like

Thanks @Anke

1 Like

hello, finally with this code I was able to fix my problem, thank you

1 Like

you might want to provide a screenshot of your final solution...
this might help someone in future with the same question...
thank you

Taifun

2 Likes

Ok,
here is the screenshot of the program that fixed the error :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.