Detect that there is a call

Hello,

  1. How do you make the application recognize when there is an incoming call on the device even when the application is not running.

  2. How do you make the application recognize the incoming number and save it in a variable?

Thanks in advance! :blush:

You can try to get this running with the phonecall component

together with itoo for background processing

Taifun

1 Like


Wow you are just a champion…
you helped me alot!.

I’m not good with the language.
Can you tell me which block?!
I will take a screenshot to make it easy for you

From the documentation

Phone Call Started

Event indicating that a phonecall has started. If status is 1, incoming call is ringing; if status is 2, outgoing call is dialled. phoneNumber is the incoming/outgoing phone number.

Taifun

Thanks
But I didn’t understand how to do if it will be mode “1” or mode “2”

The event will be triggered in both cases
Taifun

Thank you,
And what do we do with the running blocks in the background?

Sorry for the bother

???
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

That’s exactly the point.
I haven’t put any block yet, because I don’t know what block is needed.

I will explain what I need:

  1. That my application will run in the background all the time (meaning that the application does not need to be opened, but it will work all the time even when it is closed).

  2. That if someone calls the device (of course even when the application is closed) then the application will insert the phone number into the variable that is defined.

Hope you understood.

I already explained what needs to be done in my first answer

If you need help with this, you can contact me privately and I am happy to help for a small fee.

Taifun

Typhoon, you know perfectly well that this component CANNOT work in the BACKGROUND. Why are you misleading a person?

Why do you think so? I disagree. It should be doable.

Taifun

I now looked into this more in detail…

as the phone call component is written, it unregisters the broadcast receiver which listens to changes of the phone state when the app closes…so the phonecall component can’t be used to listen to events in the background…

here are the blocks of the not working test project

however an extension could be written which continues to listen to phone state changes to also receive that event in the background

Taifun

2 Likes

It does not work?
Well what do I do with it?

Great that you appreciate the blocks I prepared for you. .

You can use exactly these blocks together with a phone call extension, which first has to be written, but can have exactly the same functionality as the phone call component with the only difference to not unregister the broadcast receiver on closing the app

You can contact me personally if you want me to create that extension for a small fee.

Taifun