How to get phone number of incoming call in iOS Swift?

2 Solutions Collect From Internet About “How to get phone number of incoming call in iOS Swift?”

You will never be able to get the phone number of the incoming call since this is users private data, Apple will not allow you to acces the data.Its strictly restricted by Apple

Check out Core Telephony Framework: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/index.html

There is CTCall method, But CTCall identifying the call will only tell you the cureent state of call i.e is call being accepted or rejected. The callID of CTCall will just give you an unique identifier for that call but not the number being called.

NOTE your app should be in foreground state, otherwise it will not work.