I have a problem is when user is calling and press button "end call" in iOS. How to handle event user press button "end call" and trigger it with my app. I use Xamarin Forms and don't know how handle it, please help me! Thanks!
Asked
Active
Viewed 211 times
0
-
Where is your End Call button? Is that inside your App or you are talking about IPhone Call Screen? Could you please post what you did and where it didn't worked? – N Subedi Sep 10 '18 at 21:58
-
@NirmalSubedi mean to my app can handle event when user press button "end call" (it is IPhone Call Screen). Thanks! – Huu Bao Nguyen Sep 11 '18 at 09:26
-
@HuuBaoNguyen that is not possible on iOS (the system phone app is not exposed for API consumption due to security/privacy concerns) – SushiHangover Sep 11 '18 at 14:06
-
@SushiHangover I saw another app that made something that could help to go a bit in the direction. Apparently there is an event "call finish" that can be captured. But it does not show the number that called, that must be searched manually, but still at least it triggers the user to register the call. https://www.youtube.com/watch?v=n8BEZuQlXFs – Huu Bao Nguyen Sep 11 '18 at 14:28
-
@HuuBaoNguyen You used to be able to do that via CTCallCenter (Core Telephony), but that was deprecated after iOS 10. I *personally* do not know of another way without doing call forwarding via an iOS VoIP app (we forward the user's phone number to a VoIP server, and then forward that call (now a VoIP-based one) back the phone and thus our VoIP app answers the call and tracks duration, caller id, call logging, 3rd-party integrations, etc...) – SushiHangover Sep 11 '18 at 14:59
1 Answers
0
iOS is very security. So, you can handler event when user press button "End call" on iOS but you can't get Phone Number or record conversation of user. Try it, you can handler event:
if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
{
_callObserver = new CXCallObserver();
temp = new MyCXCallObserverDelegate();
_callObserver.SetDelegate(temp, null);
}
else
{
_callCenter = new CTCallCenter();
_callCenter.CallEventHandler += CallEvent;
}
Reference: Detecting the call events in ios
Note: Use CallCenter
library for ios version < 11.
And Callkit
library for ios version >= 11