4

I want to capture the incoming call event using Phonegap. I want to detect if there is any event of incoming call occured and pause my media files from playing. So far I have found about startcallbutton & *endcallbutton*events. But I want to detect the call from the moment of ringing. Searched in Phonegap google group but not finding any solution that could work for me.

I'm new to phonegap. Am I missing something? Can anyone please help me that how can I detect the incoming call and take action after that? Is that solution device independent?

AtanuCSE
  • 8,832
  • 14
  • 74
  • 112
  • Use this http://simonmacdonald.blogspot.in/2012/12/how-to-get-devices-phone-number-using.html reference for detect incoming call. – Harshit Rathi Dec 03 '13 at 06:13

2 Answers2

3

Maybe this plugin solves it for you? https://github.com/renanoliveira/cordova-phone-call-trap

Do note that you will always require a plugin, since Phonegap/Cordova has no API to detect calls. And plugins are platform specific, but since you tagged your question Android I suppose you only target Android?

Jan Misker
  • 2,129
  • 16
  • 26
0

as I as I could remember, you should set up intent filter for calling event, and get action from that event...and handle it.

reading the following material will help you to understand~

Retrieve incoming call's phone number in Android

http://developer.android.com/reference/android/telephony/TelephonyManager.html#ACTION_RESPOND_VIA_MESSAGE

How to detect incoming calls, in an Android device?

Community
  • 1
  • 1
shanwu
  • 1,493
  • 6
  • 35
  • 45