iOS Question How to read missed calls or check phone state?

susu

Well-Known Member
Licensed User
I hate to call your name but please help me @Erel - The Ultimate!
 

susu

Well-Known Member
Licensed User
I need to verify user's phone number by make a call to him. If I can detect phone state and check it's my phone number calling, I can approve him.
 

Erel

Administrator
Staff member
Licensed User
You can use this code to listen for incoming calls:
B4X:
Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   NavControl.ShowPage(Page1)
   Page1.RootPanel.LoadLayout("1")
   Dim no As NativeObject = Me
   no.RunMethod("ListenForCalls", Null)
End Sub

Sub State_Changed(call As Object)
   Log("call: " & call)
End Sub

#if objc
#import <CoreTelephony/CTCallCenter.h>
- (void)ListenForCalls {
   static CTCallCenter* cc;
   cc = [[CTCallCenter alloc] init];
   [cc setCallEventHandler: ^(CTCall* call) {
  [self.bi raiseEvent:nil event:@"state_changed:" params:@[call]];
  }];
}
#end if
However it will not include the phone number. This information is not available:
https://developer.apple.com/library...etworkingInternet/Reference/CTCall/index.html
 

susu

Well-Known Member
Licensed User
Thanks Erel.
You mean there's no way to read call log or incoming call?
 

JanPRO

Well-Known Member
Licensed User

susu

Well-Known Member
Licensed User
I read about it but you only can read it when you backup that database to computer. I need to read call log inside iOS.
After some search on Google, I think it's unpossible to read call log or even know who is calling. So I need to ask user input the missed call number manually.
Ps: That's why iOS suck! :D
 
Top