iOS CallKit Directory Extension Tips

Tips:

  1. The label text that you see will have the following format: Caller ID:  You can change the app name part of the label by changing app’s Bundle Name.
  2. You must provide a full country code and area code with the phone number.
  3. -reloadExtensionWithIdentifier:completionHandler:, which requests to have your app extension’s data reloaded by the system. Call this whenever you have new blocking or identification data to provide to the system.
  4. -getEnabledStatusForExtensionWithIdentifier:completionHandler:, which allows your app to query whether its extension has been enabled in Settings. Call this from within your app before requesting to reload data, and perhaps prompt the user to first enable your extension in Settings in order to begin loading data.
  5. The array of phone numbers must be a sorted list of int64’s. From smallest to largest. The list will be rejected with an “entries out of order” error otherwise.
  6. Store all the contacts to directory every time, because directory is getting recreated (loosing the previous contacts). Checked in iOS 11.
  7. Make sure the phone numbers are of type NSNumber instead of NSString.
Advertisements

CoreTelephony CTCallCenter

The [[CTCallCenter alloc] init] must be run in the main queue. Is it thread safe ??? Better call it on main thread only.

There is an iOS bug that causes instances of the CTCallCenter class to sometimes get notifications after they have been deallocated. Instead of instantiating, using, and releasing instances you must instead retain and never release them to work around the bug.

static CTCallCenter *netInfo; static dispatch_once_t dispatchToken; if (!netInfo) { dispatch_once(&dispatchToken, ^{ netInfo = [[CTCallCenter alloc] init]; }); }

 

Basic topics a mac developer should know

  • MVC Pattern
  • Memory Management
  • Archiving Data
  • User Defaults
  • Localization
  • Categories
  • Formal and informal Protocols
  • Key Value coding
  • Key Value observing
  • Custom Drawing
  • Notifications
  • Delegation
  • Blocks
  • Threads
  • Core Animation
  • Debugging
  • Instruments
  • Predicates
  • Custom Drawing
  • Bindings
Blogged with the Flock Browser